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

[feature request] Add support for .eslintrc directory #13578

Closed
ctjlewis opened this issue Aug 17, 2020 · 8 comments
Closed

[feature request] Add support for .eslintrc directory #13578

ctjlewis opened this issue Aug 17, 2020 · 8 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion auto closed The bot closed this issue core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@ctjlewis
Copy link

ctjlewis commented Aug 17, 2020

The version of ESLint you are using.
latest

The problem you want to solve.
I want to be able to store an eslint config as its own standalone git repository, so it can be added to other repositories with git submodule add and managed independently. Git repos must be folders.

Your take on the correct solution to problem.
.eslintrc check for a directory ./ should also detect a .eslint/ or .eslintrc/ directory, and then use the default .eslintrc* logic to select a config .eslintrc* in that folder and apply it with respect to the parent folder ./.

Are you willing to submit a pull request to implement this change?
Yes.

@ctjlewis ctjlewis 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 Aug 17, 2020
@anikethsaha
Copy link
Member

Thanks for the issue.

Though this is not 100% what you are looking for, maybe --config can be helpful like give --config .eslintrc/.eslintrc but it won't work completely as you want.

so about the proposal, this an interesting one, I have seen many tools supporting this. It would be helpful for a better project structure.

You need to submit an RFC for detailed design. But we can discuss here about the interest and queries from others.

@anikethsaha anikethsaha added 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 Aug 18, 2020
@aladdin-add
Copy link
Member

aladdin-add commented Aug 18, 2020

to clarify:

  • eslint <7.0 does ignores .* files by default
  • as of eslint v7.0, it does not ignore .eslintrc* by default

and, it will be changed in eslint v8, as you expected. :)

previous discussion:

@aladdin-add aladdin-add 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 evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Aug 18, 2020
@aladdin-add
Copy link
Member

aladdin-add commented Aug 18, 2020

atm, you can add a !.eslintrc/ in your .eslintignore

@kaicataldo
Copy link
Member

kaicataldo commented Aug 18, 2020

I don't think core should support this, as there are a few ways to achieve this already:

  1. Putting a standard config file in the project root that extends the shared config in the Git submodule. This is how shared configs installed via npm also work.
  2. Using the --config CLI flag.

@aladdin-add
Copy link
Member

emm.. I've misread the issue somehow, please disregard my comment. 🤣

@aladdin-add aladdin-add added core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed question This issue asks a question about ESLint labels Aug 18, 2020
@ctjlewis
Copy link
Author

ctjlewis commented Aug 19, 2020

Hey everyone, thank you for your comments and suggested workarounds.

This definitely isn't a needed feature, I would just find it super convenient to add my ESLint config to repos with version control using git submodule add. This could be extended further with GitHub templates so that setup involves zero steps as long as you have a global install of ESLint active via npm i -g eslint. Atm, I don't see a way of setting up config without publishing it to NPM or manually copying it over to each new project.

Admittedly, I dream of a day when Travis, NPM, and Git all respect a dot folder called .config/ so everyone doesn't have 18 dotfiles piling up in root (.eslintrc, .travis.yml, .npmignore, .gitignore, Rollup configs, Webpack configs, etc.).

@mdjermanovic
Copy link
Member

extends can accept relative paths. Config file in a project could be as simple as:

{
  "extends": ["./.eslint/.eslintrc"]
}

@eslint-deprecated eslint-deprecated bot added the auto closed The bot closed this issue label Sep 20, 2020
@eslint-deprecated
Copy link

Unfortunately, it looks like there wasn't enough interest from the team
or community to implement this change. While we wish we'd be able to
accommodate everyone's requests, we do need to prioritize. We've found
that issues failing to reach accepted status after 21 days tend to
never be accepted, and as such, we close those issues.
This doesn't mean the idea isn't interesting or useful, just that it's
not something the team can commit to.

Thanks for contributing to ESLint and we appreciate your understanding.

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 20, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Mar 20, 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 auto closed The bot closed this issue core Relates to ESLint's core APIs and features enhancement This change enhances an existing feature of ESLint 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

5 participants