From e8ceb339ace2798e67ac932c00015ef7ae243f13 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 23 Jun 2021 14:52:10 -0500 Subject: [PATCH 1/3] Add note about adding additional types --- docs/basic-features/typescript.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md index 9c7d14640276a..b42ef84438f9a 100644 --- a/docs/basic-features/typescript.md +++ b/docs/basic-features/typescript.md @@ -57,6 +57,8 @@ You're now ready to start converting files from `.js` to `.tsx` and leveraging t > TypeScript `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`. +> Additional types can be added to your project separate of `next-env.d.ts` by adding a separate file e.g. `additional.d.ts` and then adding it to the `include` config in your `tsconfig.json` + By default, Next.js will do type checking as part of `next build`. We recommend using code editor type checking during development. If you want to silence the error reports, refer to the documentation for [Ignoring TypeScript errors](/docs/api-reference/next.config.js/ignoring-typescript-errors.md). From 6b062cc3e1f316a606b063f1ee91c26141610deb Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 23 Jun 2021 14:58:56 -0500 Subject: [PATCH 2/3] Update to bold edit also --- docs/basic-features/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md index b42ef84438f9a..f1915892ef9fc 100644 --- a/docs/basic-features/typescript.md +++ b/docs/basic-features/typescript.md @@ -53,7 +53,7 @@ npm run dev You're now ready to start converting files from `.js` to `.tsx` and leveraging the benefits of TypeScript!. -> A file named `next-env.d.ts` will be created in the root of your project. This file ensures Next.js types are picked up by the TypeScript compiler. **You cannot remove it**, and it should not be edited as it can change at any time. +> A file named `next-env.d.ts` will be created in the root of your project. This file ensures Next.js types are picked up by the TypeScript compiler. **You cannot remove it or edit it** as it can change at any time. > TypeScript `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`. From bc19c08dab529b0047508c76b61a37947e795296 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Wed, 23 Jun 2021 15:00:58 -0500 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Steven --- docs/basic-features/typescript.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basic-features/typescript.md b/docs/basic-features/typescript.md index f1915892ef9fc..80949dd0b6f74 100644 --- a/docs/basic-features/typescript.md +++ b/docs/basic-features/typescript.md @@ -57,7 +57,7 @@ You're now ready to start converting files from `.js` to `.tsx` and leveraging t > TypeScript `strict` mode is turned off by default. When you feel comfortable with TypeScript, it's recommended to turn it on in your `tsconfig.json`. -> Additional types can be added to your project separate of `next-env.d.ts` by adding a separate file e.g. `additional.d.ts` and then adding it to the `include` config in your `tsconfig.json` +> Instead of editing `next-env.d.ts`, you can include additional types by adding a new file e.g. `additional.d.ts` and then referencing it in the [`include`](https://www.typescriptlang.org/tsconfig#include) array in your `tsconfig.json`. By default, Next.js will do type checking as part of `next build`. We recommend using code editor type checking during development.