7.21.0 release not ignoring node_modules ?
See original GitHub issueNode version: v14.15.5 npm version: v6.14.11 Local ESLint version: v7.21.0 (Currently used) Global ESLint version: Not found Operating System: Linux (ubuntu variant)
What parser (default, @babel/eslint-parser
, @typescript-eslint/parser
, etc.) are you using?
I think @babel/eslint-parser
?
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
Upgraded from eslint 7.20.0 to 7.21.0, then ran the command below;
yarn eslint .
What did you expect to happen? No eslint errors when upgrading from eslint 7.20.0 to 7.21.0
What actually happened? Please copy-paste the actual, raw output from ESLint. Eslint errors in node_modules (ignore the warnings, tonnes of those in the app)
$ yarn eslint .
yarn run v1.22.10
$ /home/username/my-app/node_modules/.bin/eslint .
/home/username/my-app/node_modules/.bin/sha.js
3:1 error Unexpected var, use let or const instead no-var
3:1 error Expected 1 empty line after require statement not followed by another require import/newline-after-import
4:1 error Unexpected var, use let or const instead no-var
7:3 error Unexpected var, use let or const instead no-var
8:3 error Unexpected var, use let or const instead no-var
35:5 error All 'var' declarations must be at the top of the function scope vars-on-top
35:5 error Unexpected var, use let or const instead no-var
36:5 error All 'var' declarations must be at the top of the function scope vars-on-top
36:5 error Unexpected var, use let or const instead no-var
37:21 error Unexpected require() global-require
✖ 1297 problems (10 errors, 1287 warnings)
7 errors and 227 warnings potentially fixable with the `--fix` option.
error Command failed with exit code 1.
Steps to reproduce this issue:
- Have a yarn-based application (I say yarn, but I am not sure if that has anything to do with it)
- Upgrade to 7.21.0
- Run
yarn eslint .
in the application directory
These errors are solved by either;
- adding
node_modules/
to .eslintignore (which the https://eslint.org/docs/user-guide/configuring/ignoring-code says should be ignored by default) - downgrading to 7.20.0
Are you willing to submit a pull request to fix this bug?
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
For anyone stumbling onto this, this will be fixed in an upcoming version of ember-cli https://github.com/ember-cli/ember-cli/pull/9456
Until then you can add the
.*/
into the.eslintignore
file yourselfAs it turns out, this
!.*
is present in the default eslint ignore file generated byember-cli
(as of v3.24 anyway) https://github.com/ember-cli/ember-new-output/blob/7faae3f8d1c029efb0e47664d5ef232a9ef912ac/.eslintignore#L15I’ll submit an issue there and see what they think about adjusting it