From 0344c35bb77f11f94b63e2dec5115512eefd2708 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 24 Jun 2021 10:32:46 -0500 Subject: [PATCH] Add comment to not edit in next-env file (#26573) This adds a comment to the generated `next-env.d.ts` to mention it should not be edited pointing to the documentation which contains an example of adding custom types separately. x-ref: https://github.com/vercel/next.js/issues/26560 ## Documentation / Examples - [x] Make sure the linting passes --- packages/next/lib/typescript/writeAppTypeDeclarations.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/next/lib/typescript/writeAppTypeDeclarations.ts b/packages/next/lib/typescript/writeAppTypeDeclarations.ts index 9bc1a039dd56b..10994fcff3d8d 100644 --- a/packages/next/lib/typescript/writeAppTypeDeclarations.ts +++ b/packages/next/lib/typescript/writeAppTypeDeclarations.ts @@ -17,6 +17,10 @@ export async function writeAppTypeDeclarations( os.EOL + (imageImportsEnabled ? '/// ' + os.EOL - : '') + : '') + + os.EOL + + '// NOTE: This file should not be edited' + + os.EOL + + '// see https://nextjs.org/docs/basic-features/typescript for more information.' ) }