You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you set up a new Vite project using npm create vite@latest, the skeleton it generates will only lint JSX files if you run npm run lint, but will silently ignore JSX files if you run npx eslint ..
Since npx eslint . is a common way to run eslint, I think Vite's default setup should support that way of running it, instead of simply ignoring JSX files and giving the false impression it checked those.
(The supported way to run eslint is the npm run lint script Vite adds, but it's easy to not notice that should be used, and it's bad that not realizing that exists results in potentially a bunch of false negatives)
Describe the bug
If you set up a new Vite project using
npm create vite@latest
, the skeleton it generates will only lint JSX files if you runnpm run lint
, but will silently ignore JSX files if you runnpx eslint .
.Since
npx eslint .
is a common way to run eslint, I think Vite's default setup should support that way of running it, instead of simply ignoring JSX files and giving the false impression it checked those.(The supported way to run eslint is the
npm run lint
script Vite adds, but it's easy to not notice that should be used, and it's bad that not realizing that exists results in potentially a bunch of false negatives)Reproduction
https://github.com/phoenixeliot/vite-eslint-jsx-demo
Steps to reproduce
npm create vite@latest
. Select "React" and "Javascript" in the prompts.for (var i = 0; i < 10; i--) { }
npx eslint .
in the terminalResult: No errors are shown.
npm run lint
Result: This time, a lint error is shown.
However, if we add this to .eslintrc.cjs,
npx eslint .
works:System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: