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

Support "ignorePath" as top level configuration setting #13361

Closed
medikoo opened this issue May 26, 2020 · 4 comments
Closed

Support "ignorePath" as top level configuration setting #13361

medikoo opened this issue May 26, 2020 · 4 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

@medikoo
Copy link
Sponsor

medikoo commented May 26, 2020

Currently the only way to use alternate ignore file is to pass --ignore-path into CLI, and that's quite limited as it doesn't ensure that desired ignore file is respected by default in every lint check for given project.

That affects IDE configurations. e.g. on my side in most of the projects I want ESLint by default to treat .gitignore as ignore file, for that I have lint scripts configured as eslint --ignore-file=.gitignore ., but that's not picked by VSCode ESLint extension, which anyway doesn't want to lint files that start with a . which are otherwise linted by lint scripts.

@medikoo medikoo added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels May 26, 2020
@mysticatea
Copy link
Member

Thank you for your request.

You can do like below:

// .eslintrc.js
const fs = require("fs")

module.exports = {
    ignorePatterns: fs.readFileSync(".gitignore", "utf8").split("\n").filter(Boolean),
    // other settings.
}

@medikoo
Copy link
Sponsor Author

medikoo commented May 26, 2020

@mysticatea thanks, that indeed works as workaround. Still it'll be nice to be able to achieve without a need of JS file configuration or copying a settings

@kaicataldo kaicataldo added question This issue asks a question about ESLint and removed core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint triage An ESLint team member will look at this issue soon labels Jun 11, 2020
@aleclarson
Copy link

aleclarson commented Jul 12, 2020

+1

Please add this. The workaround above is incompatible with .eslintrc.json modules.

@nzakas
Copy link
Member

nzakas commented Aug 10, 2020

To close the loop here: we aren't making any further changes to the configuration system. We are working on a new configuration system (defined in eslint/rfcs#9) and there will be more options for specifying ignore files.

@nzakas nzakas closed this as completed Aug 10, 2020
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2021
@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, 2021
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

5 participants