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

Set ignore path in .eslintrc #3529

Closed
remcohaszing opened this issue Aug 26, 2015 · 12 comments
Closed

Set ignore path in .eslintrc #3529

remcohaszing opened this issue Aug 26, 2015 · 12 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

@remcohaszing
Copy link
Contributor

The ESLint docs show an example of how to use .gitignore as the ignore path.

This seems a very useful feature to me. However, my editors don't support this.

It would be useful to specify the ignore-path in .eslintrc instead of as a command line parameter. This way editors or whatever tools using ESLint don't have to supply this.

@eslintbot
Copy link

Thanks for the issue! We get a lot of issues, so this message is automatically posted to each one to help you check that you've included all of the information we need to help you.

Reporting a bug? Please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. The source code that caused the problem
  3. The configuration you're using (for the rule or your entire config file)
  4. The actual ESLint output complete with line numbers

Requesting a new rule? Please be sure to include:

  1. The use case for the rule - what is it trying to prevent or flag?
  2. Whether the rule is trying to prevent an error or is purely stylistic
  3. Why you believe this rule is generic enough to be included

Requesting a feature? Please be sure to include:

  1. The problem you want to solve (don't mention the solution)
  2. Your take on the correct solution to problem

Including this information in your issue helps us to triage it and get you a response as quickly as possible.

Thanks!

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Aug 26, 2015
@lo1tuma
Copy link
Member

lo1tuma commented Aug 26, 2015

I don’t think this is possible, because you can have multiple .eslintrc files but only one ignore file.

@ilyavolodin
Copy link
Member

Also .eslintrc's are constructed during traversing, so being able to specify it in .eslintrc would not be possible at all. You can, however, specify ignore pattern (or ignore path) on CLI.

@nzakas
Copy link
Member

nzakas commented Aug 26, 2015

We investigated this before and determined it would be a lot of work for something that we already have via .eslintignore. I'd suggestion contacting the editor/plugin author to ask them to add support for .eslintignore.

@nzakas nzakas closed this as completed Aug 26, 2015
@jaydenseric
Copy link

You can set ignorePath within stylelint config. They went to the trouble to switch to node-ignore to facilitate pointing ignorePath to .gitignore.

As time goes on we find ourselves linting all the things. Having separate .gitignore, .eslintignore, .stylelintignore, etc. files that contain the same rules is tedious. Junior devs generally know to update .gitignore when messing with the project but always forget the separate linting configs.

It would be awesome if eslint supported setting ignorePath in config and not just via CLI, then 3 files would become one. The growing number of config files floating around our project roots is tiresome, internally we have a policy of consolidating all config possible in package.json.

The only thing preventing the dream of all linting config in package.json, all referencing .gitignore is this issue 😢

@moos
Copy link

moos commented Oct 3, 2016

Would be very nice to have!

@wouterrutgers
Copy link

This has my upvote!

@michaeljonathanblack
Copy link

Wish this wasn't closed. We've managed to wrangle all of our dotfiles into their own directory except for this little guy.

@justin808
Copy link

You got my upvote!

@damianobarbati
Copy link

any news on this? How can I tell eslint to ignore the same files specified in my .gitignore in the package.json eslintConfig entry?

azz added a commit to azz/styled-css-grid that referenced this issue Jul 30, 2017
With the following, editors don't know how to exclude files:

    eslint . --ignore-path .gitignore

eslint/eslint#3529
azz added a commit to azz/styled-css-grid that referenced this issue Jul 30, 2017
With the following, editors don't know how to exclude files:

    eslint . --ignore-path .gitignore

eslint/eslint#3529
@onury
Copy link

onury commented Dec 26, 2017

@nzakas This should be re-opened. Multiple config files is not right.

BTW, referencing .gitignore does not solve it. You might have bundled dependencies to be commited to Git that are not to be linted.

@timhuff
Copy link

timhuff commented Feb 4, 2018

I came here looking for a ignore property for .eslintrc.js. It hadn't occurred to me that I should make it the same as my .gitignore file. If anyone wants to do this, I believe running ln -s .gitignore .eslintignore in project root should do the trick.

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

No branches or pull requests