From 378cb6a5526b38e64ec551f6a21995f3f3758fa6 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Mon, 28 Oct 2019 22:22:43 -0400 Subject: [PATCH 1/2] Split TypeScript Flag Docs --- packages/next/README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/next/README.md b/packages/next/README.md index c20c3fd7817c1..f7eedfc8507f7 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -2317,16 +2317,35 @@ To learn more about TypeScript checkout its [documentation](https://www.typescri > When you feel comfortable with TypeScript, you may turn this option on in your `tsconfig.json`. > **Note**: By default, Next.js reports TypeScript errors during development for pages you are actively working on. -> TypeScript errors for inactive pages do not block the development process. -> Trying to run `next build` for an app that has TypeScript errors on any page will fail. -> -> If you don't want to leverage this behavior and prefer to do type checks manually, set the following options in your `next.config.js`: +> TypeScript errors for inactive pages **do not** block the development process. +> +> If you don't want to leverage this behavior and instead, e.g. prefer your editor's integration, you can set the following option in `next.config.js`: > > ```js > // next.config.js > module.exports = { > typescript: { > ignoreDevErrors: true, +> }, +> } +> ``` +> +> Next.js will still fail your **production build** (`next build`) when TypeScript errors are present in your project. +> +> If you'd like Next.js to dangerously produce production code even when your application is broken, you can set the following option in your `next.config.js`. +> Be sure you are running type checks as part of your build or deploy process! +> +> ```js +> // next.config.js +> module.exports = { +> typescript: { +> // !! WARN !! +> // Dangerously allow Next.js to successfully build even if your project has +> // type errors. +> // +> // This option is rarely needed, and should be reserved for advanced +> // setups. You may be looking for `ignoreDevErrors` instead. +> // !! WARN !! > ignoreBuildErrors: true, > }, > } From 320680ca89642e0998eba0dfd54eeba0eaab9975 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Mon, 28 Oct 2019 22:24:48 -0400 Subject: [PATCH 2/2] reword --- packages/next/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/next/README.md b/packages/next/README.md index f7eedfc8507f7..9bdf0694099e7 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -2340,8 +2340,8 @@ To learn more about TypeScript checkout its [documentation](https://www.typescri > module.exports = { > typescript: { > // !! WARN !! -> // Dangerously allow Next.js to successfully build even if your project has -> // type errors. +> // Dangerously allow production builds to successfully complete even if +> // your project has type errors. > // > // This option is rarely needed, and should be reserved for advanced > // setups. You may be looking for `ignoreDevErrors` instead.