Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Before You File a Documentation Request Please Confirm You Have Done The Following...
- I have looked for existingopen or closed documentation requests that match my proposal.
- I haveread the FAQ and my problem is not listed.
Suggested Changes
When starting a TypeScript repository from scratch using our docs, the typical flow is:
...however, we don't mention anything about how to get typed linting working (or excluded) for the.eslintrc.(c)js
file we tell the user to write. As a result, the file receives this lovely complaint:
Parsing error: ESLint was configured to run on `<tsconfigRootDir>/.eslintrc.cjs` using `parserOptions.project`: /users/josh/repos/repros/tsconfig.jsonHowever, that TSConfig does not include this file. Either:- Change ESLint's list of included files to not include this file- Change that TSConfig to include this file- Create a new TSConfig that includes this file and include it in your parserOptions.projectSee the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-fileeslint
That's a very wordy complaint for a first-time typed linting user to receive. Not ideal.
I'm not sure what the best way to resolve this is. A few starting options:
- Useconfig
overrides
to restrict type checking to.ts
,.tsx
,.cts
, etc. files(I'm a little negative on this, as it makes the config more complex) - Tell them to exclude that ESLint config from being linted(I don't like this - many of us want to lint all our files)
- Have the user
allowJs
in their TSConfig used for ESLint(I really don't like this - users will need to either add a new TSConfig for linting or modify their main project's compiler options)
...I don't love any of those 🤔. How are users "supposed" to fix this?
This issue came out of a Twitch stream with@Jutanium. 👋