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 ! not working. (exclude) #5728

Closed
rstudner opened this issue Mar 29, 2016 · 11 comments
Closed

eslintignore ! not working. (exclude) #5728

rstudner opened this issue Mar 29, 2016 · 11 comments
Assignees
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 evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@rstudner
Copy link

Using eslint 2.5.1

my .eslintignore file is:

node_modules
app/assets/javascripts
!app/assets/javascripts/pickAnyFolder

This doesn't work. It ignores pickAnyFolder. I can't seem to use the ! syntax at all with 'conflicting rules'.

Is this a known issue (I can't seem to find it)

so I have to do:

node_modules
app/assets/javascripts/folder1
...
app/assets/javascripts/foldern

basically... and then just not include a specific directory in the ignore. Pain!

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Mar 29, 2016
@ilyavolodin
Copy link
Member

@rstudner v2.5.1 had some known issues with npm bundling, could you try this same thing with v2.5.3 please?

@ilyavolodin ilyavolodin added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Mar 29, 2016
@rstudner
Copy link
Author

Didn't make any positive difference. The ! appears to not be working.

BTW, I'll try from the command line -- i'm currently using RubyMine to 'visualize' the results and possibly this is affecting things

(though again, if I don't try to rely on !, everything works 100%)

@alberto
Copy link
Member

alberto commented Mar 29, 2016

You can't unignore something in an ignored folder.

Instead, you can do

app/assets/javascripts/**
!app/assets/javascripts/pickAnyFolder

@rstudner
Copy link
Author

alberto - I tried that as well (as below)

node_modules
app/assets/javascripts/**
!app/assets/javascripts/visibility_dashboard
spec

It won't run on any files under visibility_dashboard with the above.

I tried
!app/assets/javascripts/visibility_dashboard/** as well of course.

@alberto
Copy link
Member

alberto commented Mar 29, 2016

Confirmed on 2.5.3

@alberto alberto added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Mar 29, 2016
@alberto
Copy link
Member

alberto commented Mar 30, 2016

I'll have a look at this

@IanVS
Copy link
Member

IanVS commented Mar 31, 2016

I think the double globstar (**) is not what you want here. Instead, it should be:

app/assets/javascripts/*
!app/assets/javascripts/pickAnyFolder

With that syntax, everything works as expected when I test (meaning, everything is ignored except for pickAnyFolder).

@IanVS IanVS added evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed accepted There is consensus among the team that this change meets the criteria for inclusion labels Mar 31, 2016
@rstudner
Copy link
Author

I believe a "great odin's raven" works out nicely here.

That works for me as well thanks :)

Now, the key, is that how it is supposed to work hah.

@IanVS
Copy link
Member

IanVS commented Mar 31, 2016

Yes, our .eslintignore file is supposed to work the same way as a .gitignore file. And using a trailing ** doesn't work in a .gitignore file either.

@IanVS IanVS closed this as completed Mar 31, 2016
@alberto
Copy link
Member

alberto commented Mar 31, 2016

@IanVS According to the git docs it should, but I tested on my machine (git 2.6.2) and it didn't work either. Maybe the docs are wrong?

@zirho
Copy link

zirho commented Sep 12, 2016

To exclude nested folders, something like this works.

public/js/*
!public/js/webpack
public/js/webpack/*
!public/js/webpack/src

@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 bug ESLint is working incorrectly core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

No branches or pull requests

6 participants