Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
docs: mention EXPERIMENTAL_useProjectService in parser package docs#7352
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -249,6 +249,33 @@ Please only submit bug reports when using the officially supported version. | ||
============= | ||
``` | ||
### `EXPERIMENTAL_useProjectService` | ||
An experimental alternative to `parserOptions.project`. | ||
This directs the parser to use a more seamless TypeScript API to generate type information for rules. | ||
It will automatically detect the TSConfig for each file (like `project: true`), and will also allow type information to be computed for JavaScript files without the `allowJs` compiler option (unlike `project: true`). | ||
```js | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
EXPERIMENTAL_useProjectService: true, | ||
}, | ||
}; | ||
``` | ||
This option should bring two main benefits: | ||
- Simpler configurations: most projects shouldn't need to explicitly configure `project` paths or create `tsconfig.eslint.json`s | ||
- Improved performance: this API is optimized on the TypeScript side for speed | ||
- Initial versions of this option demonstrated performance changes in subsets of the typescript-eslint monorepo ranging from 11% slower to 70% faster | ||
We're hopeful this option will eventually become the standard way to enable typed linting. | ||
It switches the parser from manually creating TypeScript programs to instead calling the same "project services" API used by editors such as VS Code. | ||
However, because it's so new and untested, we're keeping it under the `EXPERIMENTAL_` prefix for at least all of the `6.X` versions. | ||
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. fyi@jakebailey, just in case our phrasing is offputting for TypeScript-ers. I have a reminder set to merge this in time for our weekly deployment on Monday. | ||
See [feat(typescript-estree): add EXPERIMENTAL_useProjectService option to use TypeScript project service](https://github.com/typescript-eslint/typescript-eslint/pull/6754) for more information. | ||
## Utilities | ||
### `createProgram(configFile, projectDirectory)` | ||