-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split TypeScript Flag Docs #9231
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd replace There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer to drive the point home that disabling it at build is a very bad idea. |
||
> 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 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. | ||
> // !! WARN !! | ||
> ignoreBuildErrors: true, | ||
> }, | ||
> } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the improvements and sorry for being late for the party! Small comment: seems like
and instead
is redundant in this sentence.