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

ESLint upgrade needed #312

Closed
7 tasks done
danibiro opened this issue May 4, 2024 · 1 comment
Closed
7 tasks done

ESLint upgrade needed #312

danibiro opened this issue May 4, 2024 · 1 comment

Comments

@danibiro
Copy link

danibiro commented May 4, 2024

Describe the bug

ESLint recently upgraded to v9.x. This brought big changes with itself, including changing the default name of the config file to eslint.config.js; any other name that worked until now is deprecated, including .eslintrc.cjs: source.
Now, whenever I generate a project with npm create vite@latest and choose React and TypeScript with SWC (although I think the issue would still stand if I chose anything with React) I am greeted with the same .eslintrc.cjs file. Given that I have ESLint v9 downloaded globally to my machine, when I run the task from a terminal it will try to run it with my linter, not the one that was specified in the package.json file. I am well aware that if the package would not be installed on my machine it would run perfectly fine, but the project should also be upgraded, since the version vite-plugin-react uses is deprecated.

The error I am getting is irrelevant as it offers no real explanation as to why this is happening, but I will paste it here anyway:

npm run lint

> [email protected] lint
> eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0

Invalid option '--ext' - perhaps you meant '-c'?
You're using eslint.config.js, some command line flags are no longer available. Please see https://eslint.org/docs/latest/use/command-line-interface for details.

Reproduction

vite.new/react

Steps to reproduce

Run npm i -g eslint to install ESLint globally. This installs v9.x.
After, run npm run lint in the project folder. You will see the error message I dropped above, because of the version mismatch.

System Info

System:
    OS: Linux 6.2 Linux Mint 21.1 (Vera)
    CPU: (16) x64 AMD Ryzen 9 6900HX with Radeon Graphics
    Memory: 23.99 GB / 30.60 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 21.6.2 - ~/.nvm/versions/node/v21.6.2/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v21.6.2/bin/npm
  Browsers:
    Chrome: 120.0.6099.216

Used Package Manager

npm

Logs

No response

Validations

@ArnaudBarre
Copy link
Member

Hi, tools like linter are not expected to be installed globally. Support for ESLint v9 is tracked in this PR

@ArnaudBarre ArnaudBarre closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants