Skip to content

Commit

Permalink
docs: Update TypeScript plugin section for VS Code prompt (#52111)
Browse files Browse the repository at this point in the history
Hey Next.js Team, πŸ‘‹πŸ»

I noticed Next.js apps scaffolded with create-next-app weren't prompting me for the TypeScript workspace version in VS Code. After digging through the repo, I stumbled on this #49133 PR from Tim. While this PR explains why it was removed, I'm not sure the docs were ever updated to reflect this change.

This PR aims to address that with a simple note in the TypeScript Plugin section of the TypeScript docs page.

Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: Lee Robinson <9113740+leerob@users.noreply.github.com>
  • Loading branch information
4 people committed Jul 9, 2023
1 parent ea000d1 commit 922498e
Showing 1 changed file with 2 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,7 @@ Add TypeScript to your project by renaming a file to `.ts` / `.tsx`. Run `next d

Next.js includes a custom TypeScript plugin and type checker, which VSCode and other code editors can use for advanced type-checking and auto-completion.

The first time you run `next dev` with a TypeScript file open, you will receive a prompt to enable the plugin.

<Image
alt="TypeScript Prompt"
srcLight="/docs/light/typescript-prompt.png"
srcDark="/docs/dark/typescript-prompt.png"
width="1600"
height="403"
/>

If you miss the prompt, you can enable the plugin manually by:
You can enable the plugin in VS Code by:

1. Opening the command palette (`Ctrl/⌘` + `Shift` + `P`)
2. Searching for "TypeScript: Select TypeScript Version"
Expand All @@ -59,7 +49,7 @@ If you miss the prompt, you can enable the plugin manually by:
height="637"
/>

Now, when editing files, the custom plugin will be enabled. When running `next build`, the custom type checker will be used. Further, we automatically create a VSCode settings file for you to automate this process.
Now, when editing files, the custom plugin will be enabled. When running `next build`, the custom type checker will be used.

### Plugin Features

Expand Down

0 comments on commit 922498e

Please sign in to comment.