eslint-config icon indicating copy to clipboard operation
eslint-config copied to clipboard

Type aware setting affects linting of js files when react is also enabled

Open PranavSK opened this issue 4 months ago • 1 comments

Describe the bug

When using the config with react and typescript enabled with tsconfigPath set, the files that are not typescript get errors along the lines as below:

0:0  error  Parsing error: ESLint was configured to run on `<tsconfigRootDir>/tailwind.config.js` using `parserOptions.project`: <tsconfigRootDir>/tsconfig.app.json
However, 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.project
See the typescript-eslint docs for more info: https://typescript-eslint.io/troubleshooting/typed-linting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file

Reproduction

https://stackblitz.com/edit/vitejs-vite-zhjuwp?file=package.json

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm

Used Package Manager

npm

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • [X] The provided reproduction is a minimal reproducible of the bug.

Contributions

  • [X] I am willing to submit a PR to fix this issue
  • [X] I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)

PranavSK avatar Oct 02 '24 20:10 PranavSK