Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation bug: Re: linting node_modules #13006

Closed
brettz9 opened this issue Mar 6, 2020 · 1 comment · Fixed by #13054
Closed

Documentation bug: Re: linting node_modules #13006

brettz9 opened this issue Mar 6, 2020 · 1 comment · Fixed by #13054
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation

Comments

@brettz9
Copy link
Contributor

brettz9 commented Mar 6, 2020

The version of ESLint you are using.

6.8.0

The problem you want to solve.

Per https://eslint.org/docs/user-guide/command-line-interface , there is an implied need to ignore node_modules (which seems no longer to be the case per #1163):

  1. Here's one:

Here's a simple example of a .eslintignore file:
node_modules/*

  1. Also on https://eslint.org/docs/user-guide/configuring , the need to ignore node_modules seems implicit here as well:

"ignorePatterns": ["temp.js", "node_modules/"],

  1. While the following implies the opposite, I think the text could be clarified here a bit too:

In addition to any patterns in a .eslintignore file, ESLint always ignores files in /node_modules/* and /bower_components/.
...
# /node_modules/
and /bower_components/* in the project root are ignored by default

The first line is confusing as it seems to suggest one cannot get linting of node_modules or bower_components yet it is possible to reenable both of them with !.

Your take on the correct solution to problem.

  1. Remove node_modules from the examples unless to point out that one can undo the default (it may be helpful to mention that !.eslintrc.js (or !.*.js) can be added back too, at least until eslint 7 may change this behavior for !.eslintrc.js).
  2. For the third case, I think it should instead say in the first line "ESLint always ignores files by default in ..." since I am (thankfully!) able to reapply linting of node_modules (or bower_components) by adding !node_modules/** to an ignore (within an .eslintignore file or by a command such as $(npm bin)/eslint --no-inline-config --ignore-pattern='!node_modules/**' .). (I truly hope this functionality will never be dropped, btw!)

Are you willing to submit a pull request to implement this change?

Not at this time.

@brettz9 brettz9 added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Mar 6, 2020
@kaicataldo kaicataldo added documentation Relates to ESLint's documentation and removed core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Mar 17, 2020
@kaicataldo
Copy link
Member

Agreed that the docs could be improved here.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 19, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Sep 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants