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

ESLint ignoring .eslintignore #8135

Closed
xavicolomer opened this issue Feb 23, 2017 · 4 comments
Closed

ESLint ignoring .eslintignore #8135

xavicolomer opened this issue Feb 23, 2017 · 4 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion triage An ESLint team member will look at this issue soon

Comments

@xavicolomer
Copy link

xavicolomer commented Feb 23, 2017

Hi there,

I'm trying to ignore certain patterns on eslint. I tried both --ignore-pattern and .eslintignore but none is working. I also tried different patterns.

I can see that without removing ** everything works. Is when adding (**) that the rule is not applied correctly.

Tell us about your environment

  • OS: Windows 10
  • ESLint Version: v3.15.0
  • Node Version: v6.9.5
  • npm Version: 3.10.10

File Structure:

node_modules
.eslintrc.js
src
--api
---- news
------node_modules
------handler.js
------ ...

Command

Does not work
eslint . --quiet --ignore-pattern **\node_modules\ ** \ *.js

Works
eslint . --quiet --ignore-pattern *.test.js

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Feb 23, 2017
@platinumazure
Copy link
Member

Have you tried quoting your glob patterns? Sometimes glob patterns get expanded by your shell before they get to ESLint, resulting in weird behavior.

It could be something else for sure, but you should give this a try if you can.

@xavicolomer
Copy link
Author

I tried
eslint . --quiet --ignore-pattern "**\node_modules\**\*.js"

but it didn't work. thanks @platinumazure

@xavicolomer
Copy link
Author

Oh...

I am new on a Windows platform, at least in the last 10 years. I copied the path form the console, the slashes are on the opposite direction ( ̄ー ̄;

eslint . --quiet --ignore-pattern /node_modules//*.js

@platinumazure
Copy link
Member

@xavicolomer I apologize, I should have spotted that. Our ignore patterns match the gitignore spec, which requires forward slashes.

I opened #8139 for further discussion. I doubt we'll change the patterns we support, but we could probably improve the documentation a little. Please feel free to comment in that issue if you have any particular suggestions for us. Thanks!

@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 triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

3 participants