Bug: pnpm exec eslint didn't work on Mac os
See original GitHub issueEnvironment
Environment Info:
Node version: v16.17.0 npm version: v8.15.0 pnpm version: v7.9.5 Local ESLint version: v8.23.0 (Currently used) Global ESLint version: Not found Operating System: darwin 21.6.0
What parser are you using?
Default (Espree)
What did you do?
Configuration
//eslint.config.js
export default [
{
rules: {
semi: "warn",
"prefer-const": "error",
},
},
];
//Missing semicolon
Vue.use(PiniaVuePlugin)
What did you expect to happen?
config script in package.json
"lint": "eslint src/**/*.js",
run pnpm run lint
terminal print nothing.
run pnpm exec eslint src/**/*.js
, output:
/Users/zhanglolo/Documents/vscodeProjects/vue2-vite-pinia-vitest-demo/src/main.js
9:24 warning Missing semicolon semi
✖ 1 problem (0 errors, 1 warning)
0 errors and 1 warning potentially fixable with the `--fix` option.
What actually happened?
It seem like eslint didn’t work by using package.json script.
Participation
- I am willing to submit a pull request for this issue.
Additional comments
No response
Issue Analytics
- State:
- Created a year ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
Extension fails with pnpm command not found #148903 - GitHub
Hello, here the problem is with eslint. When I try to save any file I get an error. When I run the same...
Read more >ESLint not working in VSCode? Help build a troubleshooting ...
Open the command palette ( Ctrl / Cmd + Shift + P ) and select ESLint: Manage Library Execution to open the dialog...
Read more >Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >pnpm/pnpm - Gitter
i'm having a problem with dependencies of dependencies in a workspace. i'm using typescript (not sure whether that matters).
Read more >How to run eslint --fix from npm script - Stack Overflow
You can run below command: npm run lint -- --fix.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Then I think we can close this issue since eslint correctly resolves the glob when the glob is passed into eslint. The difference between the lists of files to which the glob is expanded before calling eslint might be a good question for npm/pnpm, as eslint has no control over it. ESLint’s Command Line Interface documentation suggests using quotes for consistent behavior:
Yes! but, what makes me confuses is
pnpm run lint
(npm run lint
) get different out puteslint:cli CLI args: [...]
frompnpm exec eslint src/**/*.js
(npx eslint src/**/*.js
).May be npm have do something stuff.🤨