-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
ESLint was configured to run on <tsconfigRootDir>/.eslintrc.cjs
using parserOptions.project
#13747
Comments
happening the same to me on |
Add |
Is this a painkiller? Don't solve the problem, just cover it up? |
Another fix is to use |
I might be stating the obvious here, but adding the files to
Now everything is being linted and I am not seeing any lint errors anymore. So probably this is the "correct" configuration. Caveat: Whenever you add a file to the project root which you want to be linted, you'll have to manually add that file to the |
@HendrikThePendric I get an error adding Specifically I am encountering an error whenever I add a |
Sorry my bad. Yes I meant parser, not compiler. I'll update my original post to reflect this. However, I found that the config I suggested is not working perfectly either. When I run
I can run the app in development mode, but obviously the error will cause problems whenever it is expected that the project can compile without errors. I've been able to address this to some extend:
This makes the error go away and everything still works as expected. However the TypeScript docs seem to suggest that using project references offers some performance benefits, which you would be opting out of when you ditch the I'm no TypeScript expert by any means, and by now slightly out of my depth, so take my advise with a large dose of salt. |
I only had to change these
I think eslint isn't picking up both tsconfig and tsconfig.node |
ESLint shoots a warning when linting vite.config.ts because it was not included. The warning only occured while linting through lint-staged which includes every .ts files whereas in our package.json we tell eslint to run through all the files under src/ (vite.config.ts is a the root). Workaround found here vitejs/vite#13747
Describe the bug
With React+Typescript template ESLint is configured to run on /.eslintrc.cjs but tsconfig is not configured to run on /.eslintrc.cjs.
Reproduction
https://github.com/xixixao/repro-vite-template-bad-eslint-config
Steps to reproduce
npm create vite@latest foo -- --template react-ts
cd foo
npm install
Open .eslintrc.cjs in VS Code, make some no op change like adding a new line at the end, and save the file.
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: