Skip to content

ignore node_modules folder by default [$15 awarded] #1163

@pdehaan

Description

@pdehaan

Sorry, I searched but couldn't find an existing issue for this...


Should ESLint ignore the "node_modules/**" folder by default?

I have a sample Node project with one *.js file (and ESLint installed globally) and typed:

$ eslint .

...
node_modules/syntax-error/test/sources/check.js
  5:30  error  Unexpected identifier

✖ 88164 problems

real    0m33.670s
user    0m30.912s
sys     0m0.958s

The command took ~30s and found 88k problems in my node_modules/ folder. :/
I think we'd want to automatically ignore the "node_modules/**" folder since it'd be a better "out of the box" experience.

Workaround:

Put node_modules/** in the project's .eslintignore file.

$ echo "node_modules/**" > .eslintignore

$ cat .eslintignore
node_modules/**

$ time eslint .

index.js
  1:0  error  'console' is not defined      no-undef
  1:0  error  Unexpected console statement  no-console

node_modules/hapi/test/templates/valid/helpers/.hidden.js
  1:16  error  Strings must use doublequote  quotes

✖ 3 problems

real    0m0.346s
user    0m0.293s
sys     0m0.053s

Not sure why, but even though I have node_modules/** in my .eslintignore file, it looks like it's linting node_modules/hapi/test/templates/valid/helpers/.hidden.js.

The $15 bounty on this issue has been claimed at Bountysource.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThere is consensus among the team that this change meets the criteria for inclusionarchived due to ageThis issue has been archived; please open a new issue for any further discussionbountySomeone has posted a bounty for this issue on BountySourcecoreRelates to ESLint's core APIs and featuresenhancementThis change enhances an existing feature of ESLint

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions