Skip to content
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

Merged
merged 3 commits into from
Oct 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions packages/next/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Copy link
Contributor

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.

>
> ```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`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd replace even when your application is broken with even when your application has TypeScript errors. Having TS errors does not always imply a broken app (despite that very likely it will)

Copy link
Member Author

Choose a reason for hiding this comment

The 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,
> },
> }
Expand Down