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

Unnecessary checks for config name in extend option of .eslintrc #13642

Closed
rmbaad opened this issue Sep 1, 2020 · 2 comments
Closed

Unnecessary checks for config name in extend option of .eslintrc #13642

rmbaad opened this issue Sep 1, 2020 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion 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

Comments

@rmbaad
Copy link

rmbaad commented Sep 1, 2020

Hi, there! Thank you for this great tool.
I faced the problem while creating a new ESLint config as a package to extend from it and want to ask to discuss about it.

The version of ESLint you are using.
7.7.0

The problem you want to solve.
Give more freedom to name ESLint configs

Your take on the correct solution to problem.
Currently, we have strong rules to name ESLint configs, e.g. eslint-config-myconfig, or @namespace/eslint-config-myconfig.
Please tell me, is this really justified? Yes, we can extend configs from the short name, like "extends": 'myconfig', but in the case with the name which contains namespace, is it really necessary to follow these rules?
Some companies have rules for package naming in their own namespaces, and if you want to name your config e.g. as myteam-eslint-config it doesn't work to extend from. We just will get an error like ESLint couldn't find the config "@namespace/myteam-eslint-config" to extend from, but it's the full name of package and it seems like there are no problems to find it.
Perhaps we can rethink the approach to name configs with names which contains namespace and remove checks of this rule.
Thank you!

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

@rmbaad rmbaad 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 Sep 1, 2020
@rmbaad rmbaad changed the title Unnecessary checks for config name in extend option of .eslintrc Unnecessary checks for config name in extend option of .eslintrc Sep 1, 2020
@mdjermanovic
Copy link
Member

Hi @rmbaad, thanks for the issue!

We are working on the new simple config system (eslint/rfcs#9) where the configs to extend from can be loaded from the configuration file instead of specified, so you'll be able to require a shared config with any name. You can follow the implementation progress here: #13481.

In the meantime, we have decided to not make further changes to the current config system.

While at the current config system, extends value can be an absolute or relative path, so perhaps you could do something like this in a .js config:

module.exports = {
  extends: [require.resolve("@namespace/myteam-eslint-config")]
};

@rmbaad
Copy link
Author

rmbaad commented Sep 7, 2020

Thank you, @mdjermanovic! This is a good solution.

@rmbaad rmbaad closed this as completed Sep 7, 2020
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 18, 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 18, 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 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
Projects
None yet
Development

No branches or pull requests

2 participants