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

Fallback to no prefix when searching for eslint-config modules #10202

Closed
edahlseng opened this issue Apr 11, 2018 · 6 comments
Closed

Fallback to no prefix when searching for eslint-config modules #10202

edahlseng opened this issue Apr 11, 2018 · 6 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

@edahlseng
Copy link

Currently ESLint only supports extending from configurations that are prefixed with eslint-config-. Some people may store their shared ESLint configurations in a module that has other uses as well, however (such as a module that contains multiple configurations, such as ESLint configuration, stylelint configuration, etc.). In these situations, it doesn't make sense for the module to be prefixed with eslint-config- .

I propose that when reading the extends portion of a configuration, ESLint first checks for modules prefixed with eslint-config-, and then if that fails, it continues checking for modules without the prefix.

Tell us about your environment

  • ESLint Version: 4.19.1
  • Node Version: 8.10.0
  • npm Version: 5.7.1

What parser (default, Babel-ESLint, etc.) are you using?
Babel-ESLint

Please show your full configuration:

{
  "extends": "@edahlseng/linter-configuration"
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I tried to extend configuration from a module that isn't named with a eslint-config- prefix.

What did you expect to happen?
I expected ESLint to check for a package prefixed by eslint-config- and then, if that failed, search for the exact package name.

What actually happened? Please include the actual, raw output from ESLint.
ESLint failed to find the module, with the following error: Cannot find module '@edahlseng/eslint-config-linter-configuration'.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Apr 11, 2018
@platinumazure platinumazure added enhancement This change enhances an existing feature of ESLint 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 Apr 11, 2018
@platinumazure
Copy link
Member

Hi @edahlseng, thanks for the issue!

I'm wondering if we had historical reasons for not supporting this in the past. Depending on what those might be, we can see if those are still valid and then see if this should be changed.

@edahlseng
Copy link
Author

Hi @platinumazure, it looks like this issue was brought up about a year ago in #8644, and was closed simply due to not enough support. To address that, I'm happy to spearhead the dev efforts needed to make this happen (and submitted PR #10133 as a possible solution).

@edahlseng
Copy link
Author

@platinumazure what's the latest status on this issue?

@ilyavolodin
Copy link
Member

I'm not sure I'm sold on this change. What's the problem with prefixing the packages with the specified that clearly describes what the package does? Original thinking behind prefixes was to avoid naming collision as well as increase findability and clarity.

@edahlseng
Copy link
Author

@ilyavolodin problems arise when people don't package ESLint configurations in a package all of its own. I've run into this recently where the team that I was working with packaged all of our linting configurations into one package, and so it didn't make sense to prefix the package with the name eslint-config since it wasn't just ESLint related.

@eslint-deprecated eslint-deprecated bot added the auto closed The bot closed this issue label Dec 11, 2018
@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-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jun 10, 2019
@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 Jun 10, 2019
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

3 participants