question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

7.21.0 release not ignoring node_modules ?

See original GitHub issue

Node 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:

  1. Have a yarn-based application (I say yarn, but I am not sure if that has anything to do with it)
  2. Upgrade to 7.21.0
  3. Run yarn eslint . in the application directory

These errors are solved by either;

Are you willing to submit a pull request to fix this bug?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Techn1xcommented, Apr 12, 2021

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 yourself

1reaction
Techn1xcommented, Mar 3, 2021

As it turns out, this !.* is present in the default eslint ignore file generated by ember-cli (as of v3.24 anyway) https://github.com/ember-cli/ember-new-output/blob/7faae3f8d1c029efb0e47664d5ef232a9ef912ac/.eslintignore#L15

I’ll submit an issue there and see what they think about adjusting it

Read more comments on GitHub >

github_iconTop Results From Across the Web

Eslint not ignoring node_modules folder - Stack Overflow
In my case, ESLint (v7.8.1) was ignoring node_modules directories properly, but not my dist directory. I added this to .eslintignore :
Read more >
ESLint - npm
Non -user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage. Re-releasing after a ...
Read more >
Prevent npm install for not supported Node.js versions
When I run npm install in a project with a not supported Node.js version, the following warning ( EBADENGINE ) is displayed.
Read more >
npm 7 is now generally available! - The GitHub Blog
We're announcing version 7 of the npm CLI is now generally available.
Read more >
GitHub Discovered 7 Vulnerabilities in NodeJS — What Does ...
The node_modules folder is in fact a dependency graph rather than a ... GitHub recommends an upgrade of the npm CLI to version...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found