Skip to content
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

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

Open
7 tasks done
PranavSK opened this issue Oct 2, 2024 · 1 comment · May be fixed by #622
Open
7 tasks done

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

PranavSK opened this issue Oct 2, 2024 · 1 comment · May be fixed by #622
Labels
help wanted Extra attention is needed pr welcome

Comments

@PranavSK
Copy link

PranavSK commented Oct 2, 2024

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

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

Contributions

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests (actually just go ahead and do it, thanks!)
@antfu
Copy link
Owner

antfu commented Oct 5, 2024

I don't use React myself, I am counting on the community to figure it out and send PRs. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed pr welcome
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants