-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vscode-eslint: Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. #1723
Comments
Nobody else has reported it, so it's probably something to do with the setup. could you please set |
I have the same problem, although it's for all files.
VSCode Eslint version: 2.1.1 module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'@typescript-eslint',
],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
}; |
I figured it out: I had workspace open via symlinked folder. Once I open workspace at the real folder path it works. |
It’s still happening for me @bradzacher, I’ll send you debugLog. Do you know how the vscode plugin watches for changes and adds new files to compilation context ? I feel that’s where the issue is. |
This issue is happening for our whole team currently across VSCode and Atom IDEs. Our only solution has been to remove node_modules and reinstall all packages. It usually happens when pulling in new files from Git. |
please open a new issue @gavin-gyle and provide as much information as possible. @nojvek the IDE plugin doesn't do anything - that's handled by our codebase. |
@bradzacher - We also migrating from tslint to eslint and have started facing the same issue. We have a Monorepo using "lerna" Our settings.json file has this config to support monorepo:-
Our tsconfig.json file:-
Our eslintrc.js file:-
Let me know in case i have open another issue. |
As per the error message: You don't have the file included in your tsconfig. When no file imports it, it is never added to the dependency graph, because it's not in the tsconfig. When another component imports it, typescript automatically expands the dependency graph to include that file (thereby working around the fact that your file isn't included in your tsconfig). |
I face the same problem, but this is not a typescript file it is a js file i used for binary (run with npm run wich does some work) So i can include this one but then it is not a ts file and the typescript linter try to lint this one (even if i say allowJS: false. If i add this to exclude the error is shown up this is like include or die since this file is in the root for tsconfig. Currently do not know how to fix this without change my whole folder structure. |
This comment has been minimized.
This comment has been minimized.
Do not use that option. It was added as a stop-gap to help people migrate to v2 whilst we ironed out the kinks in the new algorithm. It has been many months since we rebuilt the algorithms, and it now properly handles all the configurations and adding/removing of files. As such, Additionally using this option will exponentially increase your lint times (this is why we turn that functionality off by default in 2.0). If you are receiving this error message it means the following: You are attempting to lint a file (with type aware linting) which is not included in one of the tsconfigs you have passed to Solutions:
Again, and I cannot stress this enough, DO NOT USE |
Can you point to the actual documentation on how to set this properly? |
We have docs to help you setup your config: |
I was having the same issue, my project structure is: project Since I only want to lint the files in src, in my tsconfig.json I have With this setup, I was getting the same error, so I added .eslint.js in the .eslintignore and it works fine. If you want linting in the .eslint.js, if you add .eslint.js in the include, it will probably work |
@gSarciotto thank you! We ended up ignoring it but would like now to configure it so that |
I still have this problem every time I create a new file. VSCode complains until it restarts. |
need significantly more information than that to be able to help you. please file a new issue. |
What code were you trying to parse?
What did you expect to happen?
no errors
What actually happened?
vscode-eslint yells at me. Running in cli is fine. Only happens for new files.
I know the workaround is to restart vscode but that's like dropping a nuclear bomb to break open a coconut.
I assume it's an issue with watching for changes.
Always see this at the start of a new file. Existing files work fine. I assumed this was fixed in new version, but it seems not.
Configs
tsconfig.json
.eslintrc.js
Versions
Halp!
The text was updated successfully, but these errors were encountered: