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

.eslintignore does not filter hidden files #1077

Closed
puzrin opened this issue Jul 11, 2014 · 13 comments
Closed

.eslintignore does not filter hidden files #1077

puzrin opened this issue Jul 11, 2014 · 13 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features

Comments

@puzrin
Copy link
Contributor

puzrin commented Jul 11, 2014

/node_modules/**
**/node_modules/**

I still get errors for node_modules/less/.grunt/grunt-contrib-jasmine/boot.js and similar. Other files from node-modules folder are ignored ok.

@puzrin
Copy link
Contributor Author

puzrin commented Jul 11, 2014

I've managed to filter those files with this kludge: **/.*/**

@jonvuri
Copy link
Contributor

jonvuri commented Jul 11, 2014

We could fix this (if we want) by setting the "dot" option on minimatch.

@puzrin
Copy link
Contributor Author

puzrin commented Jul 11, 2014

I think, it's a bug.

Also, ignoring dot folders is a good way to get some speed, because .git folders scan with many files can be skipped.

@jonvuri
Copy link
Contributor

jonvuri commented Jul 11, 2014

Whether we ignore dot folders or not is a separate issue - minimatch needs to treat them however our traversal treats them. If anything it should be less restrictive.

@nzakas
Copy link
Member

nzakas commented Jul 11, 2014

I think we should just make sure the traversal skips them.

@puzrin
Copy link
Contributor Author

puzrin commented Jul 11, 2014

Hm... is it a good idea to hardcode skipping .XXX files ? Not sure.

IMHO, it's better to make ingnores work exactly as in other popular programs, instead of doing something custom.

@jonvuri
Copy link
Contributor

jonvuri commented Jul 11, 2014

IMHO, it's better to make ingnores work exactly as in other popular programs, instead of doing something custom.

In this case, our closest precedent is jshint, which also ignores dot files.

@nzakas
Copy link
Member

nzakas commented Jul 11, 2014

@puzrin I thought you were saying we should always ignore dot files and directories because that's the way other programs work?

@puzrin
Copy link
Contributor Author

puzrin commented Jul 11, 2014

@nzakas i meaned opposite - no reasons to ignore by default. May be, i didn't understood right your previous answer.

@jrajav I didn't knew it. Seriously. Meaned git, npm and so on. Jshint is "better than nothing", but i'm not sure it worth copy everything from it.

@jonvuri
Copy link
Contributor

jonvuri commented Jul 11, 2014

The difference is that git and npm manage files and directories in general. It makes sense for them to preserve everything with few questions asked. On the other hand, JSHint and ESLint are specialized tools - they act on JavaScript source code, and can be a lot more selective about what files they'll see during implicit directory traversal. It makes sense to ignore dot files and dot directories when they're not passed explicitly, because normally those are not a part of the primary source code but only accessory to it.

@puzrin
Copy link
Contributor Author

puzrin commented Jul 11, 2014

We can't be sure, what is primary and what is not. Anyway, i think, the root of problem is that scan/ignore alrogythm is reinvented from scratch, and minimatch is low-level library, that does not the same that expected to be done in ignore patterns.

@nzakas
Copy link
Member

nzakas commented Jul 12, 2014

Let's not overcomplicate the problem. JSHint ignores dot-directories (it basically does an ls of each directory). If people expect something different from ESLint, then we are probably doing something wrong. I'm fine with switching to always ignore.

@puzrin
Copy link
Contributor Author

puzrin commented Jul 12, 2014

No problem, i'll be fine with any kind of fix.

@nzakas nzakas closed this as completed in 5e601fb Jul 13, 2014
nzakas added a commit that referenced this issue Jul 13, 2014
Fix: skip dot files and ignored dirs on traverse (fixes #1077, related to #814)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 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 7, 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 bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

No branches or pull requests

3 participants