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

Add the opposite of eslintignore ("files" field) #5893

Closed
MoOx opened this issue Apr 19, 2016 · 3 comments
Closed

Add the opposite of eslintignore ("files" field) #5893

MoOx opened this issue Apr 19, 2016 · 3 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion question This issue asks a question about ESLint

Comments

@MoOx
Copy link
Contributor

MoOx commented Apr 19, 2016

From what I am reading in the docs (http://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories) there is currently only a wait to ignore files, but nothing like npm files to include the files you want from the config file.
Another example is the AVA test runner that offers a "files" field so we can choose what to test https://github.com/sindresorhus/ava#configuration

Currently I have a project with multiples node_modules folder, in multiples folders (https://github.com/MoOx/phenomic) and when I lint with the proper ignore pattern (currently, my gitignore file), it takes around 20s.
By providing only the accurate places, I cut the time to 5s.

But the command is pretty long

$ eslint src __tests__ scripts npm docs/scripts docs/src docs/web_modules boilerplate/scripts boilerplate/src boilerplate/web_modules  

What do you think about adding a "files" field in the configuration object to put all entries here, like npm and AVA (and probably others)?

(I took a quick look for opened issue, but can't find anything about that, sorry if I miss something.)

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Apr 19, 2016
MoOx added a commit to MoOx/phenomic that referenced this issue Apr 19, 2016
MoOx added a commit to MoOx/phenomic that referenced this issue Apr 19, 2016
MoOx added a commit to MoOx/phenomic that referenced this issue Apr 19, 2016
@ilyavolodin
Copy link
Member

The reason it's slow currently is that ignore patterns do not affect globing. So while files under your node_modules directory is not going to be linted, they are still being walked though when we are opening globs. There's already an open issue tracking this: #5679
Once that is fixed, I really don't see the need for both include and exclude patterns, when you specify exclude pattern, everything that doesn't match it is by definition included.

@ilyavolodin ilyavolodin added question This issue asks a question about ESLint and removed triage An ESLint team member will look at this issue soon labels Apr 19, 2016
@MoOx
Copy link
Contributor Author

MoOx commented Apr 19, 2016

Oh, that's interesting. So I am tracking this issue. Thanks for the explanation. Should I close this one then?

@ilyavolodin
Copy link
Member

I think it's safe to close, since #5679 is already tracking the same problem.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@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 Feb 6, 2018
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 question This issue asks a question about ESLint
Projects
None yet
Development

No branches or pull requests

3 participants