-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Before You File a Documentation Request Please Confirm You Have Done The Following...
- I have looked for existing open or closed documentation requests that match my proposal.
- I have read the FAQ and my problem is not listed.
Suggested Changes
@typescript-eslint/parser
sets up a TypeScript program behind-the-scenes when it parses files. The program for a file is later made on ESLintUtils.getParserServicescontext).program
. This is documented in Custom Rules > Typed Rules. That program is what's used for type information in typed lint rules.
One known issue with the parser-generating-type-information strategy is that programs are only recreated when ESLint re-parses. The VS Code ESLint editor extension has a known issue where modifying one file doesn't impact the view of that file's types seen by other files. You can view a standalone reproduction on https://github.com/JoshuaKGoldberg/repros/tree/repro-vs-code-reparse-typescript-eslint.
The current best workaround we know of is to run the Restart ESLint Server command in VS Code. That's what I recommend to folks who bring this up.
We would love a better workaround, but that's an open issue: microsoft/vscode-eslint#1774.