Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
See original GitHub issueI recently added a couple of ESLint rules that required me to add this to my .eslintrc.cjs
config:
"parserOptions": {
"ecmaVersion": "latest",
"project": "./tsconfig.json",
"parser": "@typescript-eslint/parser"
},
My .tsconfig.json
looks like:
{
"extends": "@vue/tsconfig/tsconfig.web.json",
"include": [
"env.d.ts",
"src/**/*",
"src/**/*.vue"
],
"exclude": [
"src/**/__tests__/*"
],
"compilerOptions": {
"allowJs": true,
"outDir": "dist",
"noImplicitAny": true,
"jsx": "preserve",
"composite": true,
"baseUrl": ".",
"paths": {
"@/*": [
"./src/*"
]
}
},
"references": [
{
"path": "./tsconfig.config.json"
},
{
"path": "./tsconfig.app.json"
},
{
"path": "./tsconfig.vitest.json"
}
]
}
This is causing the following error in VS Code in some of my TS and JS files:
Parsing error: “parserOptions.project” has been set for @typescript-eslint/parser. The file does not match your project config: src\lib\game\libHex.ts. The file must be included in at least one of the projects provided.eslint
The weird thing is I will get this error in a TS file in a dir, but not in another TS file in the same dir. If I rename the file with the error (something like file.ts
-> file2.ts
), the error will disappear, and it appears when I rename it back, so I assume it’s some weird caching issue. How can I fix it?
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
"parserOptions.project" has been set for @typescript-eslint ...
Parsing error : "parserOptions.project" has been set for @typescript-eslint/parser. The file does not match your project config: /Users/Dan/site ...
Read more >"parserOptions.project" has been set for @typescript-eslint ...
I have tried to change the include config as following, the error still be there. // 1. Error about js file { ...,...
Read more >"parserOptions.project" has been set for @typescript-eslint ...
The error 'Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser' occurs when we try to lint files that aren't included in our ...
Read more >How to fix VSC ESLint error "The file must be included in at ...
Parsing error : "parserOptions.project" has been set for @typescript-eslint/parser. The file does not match your project config: .eslintrc.js ...
Read more >IDE displays ESLint error "'parserOptions.project' has been set ...
IDE displays ESLint error "'parserOptions.project' has been set for '@typescript-eslint/parser'" in ".vue" files, but CLI works properly. image.png
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
I did: https://github.com/typescript-eslint/typescript-eslint/issues/5765
I am closing the issue in favour of https://github.com/typescript-eslint/typescript-eslint/issues/5765