Error generating `parserServices` for eslint plugin `@typescript-eslint`
See original GitHub issueVersions:
prettier-eslint
version: 8.8.2node
version: 11.9.0yarn
version: 1.13.0
Have you followed the debugging tips?
Yes
Relevant code or config
.eslintrc.js
parser: `@typescript-eslint/parser`,
parserOptions: {
project: `./tsconfig.json`
},
rules: {
'@typescript-eslint/no-unnecessary-type-assertion': 2
}
What I did: Run prettier (via VSCode`s FormatOnSave hook).
What happened:
Error while loading rule '@typescript-eslint/no-unnecessary-type-assertion'/home/oskar/dev/hyperapp/hyper-parcel/src/bootstrap.ts:: You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.
Problem description:
Running prettier-eslint
I get the error above. Running eslint
directly gives no errors and works as expected. I have also tried it with an absolute path to my tsconfig.json
, but the error is the same.
Reproduction repository: https://github.com/r0skar/prettier-eslint-test
Issue Analytics
- State:
- Created 5 years ago
- Reactions:33
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Error while loading rule '@typescript-eslint/dot-notation'
js file itself: Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. The file does not match your project config: ...
Read more >Setting Up Typescript with ESLint in 5 Easy Steps
Error: Error while loading rule '@typescript-eslint/dot-notation': You have used a rule which requires parserServices to be generated. If this ...
Read more >error while loading rule '@typescript-eslint/await-thenable'
ts:: You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" ...
Read more >@typescript-eslint/eslint-plugin | Yarn - Package Manager
All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines. 5.47.1 (2022-12-26). Bug Fixes. ast-spec: ......
Read more >Local Install of ESLint Breaks In-Editor Linting
0 fixed my initial issue but, as soon as I implemented a rule using the typescript-eslint plugin that required "parserServices to be generated"...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ricardolpd I was able to fix this by adding
"project": ["tsconfig.json"],
:could anyone provide an example of a config that provides a work around for this? We are facing this issue with
'@typescript-eslint/require-await'
in our mono repo.