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

Remove Package Naming Requirement #14034

Closed
Nytelife26 opened this issue Jan 24, 2021 · 5 comments
Closed

Remove Package Naming Requirement #14034

Nytelife26 opened this issue Jan 24, 2021 · 5 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

Comments

@Nytelife26
Copy link

The version of ESLint you are using.
7.18.0

The problem you want to solve.
As of present, scoped packages MUST be prefixed with eslint-config-. This is understandable for general NPM packages (somewhat, still should not be a requirement if people so desire to name it differently), but as for scoped packages where organizations can ensure there will be no naming conflicts, this is unreasonable.

Your take on the correct solution to the problem.
It should be a recommendation, not a requirement. ESLint should still allow you to use any other package name, as it is not the position of the utility to impose organizational structure.

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

@Nytelife26 Nytelife26 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 Jan 24, 2021
@ljharb
Copy link
Sponsor Contributor

ljharb commented Jan 24, 2021

Given that there's no issue with finding a name inside a scope, what's wrong with naming it @scope/eslint-config?

@mdjermanovic mdjermanovic removed the triage An ESLint team member will look at this issue soon label Jan 25, 2021
@mdjermanovic
Copy link
Member

Hi @Nytelife26, thanks for the issue!

As of present, scoped packages MUST be prefixed with eslint-config-.

That is a convention if the config is specified by its name in extends, but absolute paths are also allowed so you can specify the shared config in .eslintrc.js like this:

module.exports = {
    extends: [require.resolve("@myscope/any-package-name")]
};

It should be a recommendation, not a requirement. ESLint should still allow you to use any other package name, as it is not the position of the utility to impose organizational structure.

We are already working on the new config format per eslint/rfcs#9, where shared configs should be required directly from eslint.config.js, so there will be no restrictions or assumptions about the config's name.

You can follow the progress here: #13481.

@nzakas
Copy link
Member

nzakas commented Jan 26, 2021

As already noted, this restrictions is already being removed with eslint/rfcs#9, so closing.

@nzakas nzakas closed this as completed Jan 26, 2021
@Nytelife26
Copy link
Author

Hi @Nytelife26, thanks for the issue!

As of present, scoped packages MUST be prefixed with eslint-config-.

That is a convention if the config is specified by its name in extends, but absolute paths are also allowed so you can specify the shared config in .eslintrc.js like this:

This is actually not the case. ESLint does not register nor recognize packages, even scoped ones, unless they are prefixed with eslint-config-.

@mdjermanovic
Copy link
Member

That is a convention if the config is specified by its name in extends, but absolute paths are also allowed so you can specify the shared config in .eslintrc.js like this:

This is actually not the case. ESLint does not register nor recognize packages, even scoped ones, unless they are prefixed with eslint-config-.

Did you try with require.resolve? It should work with any package name.

@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jul 26, 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 Jul 26, 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
Projects
None yet
Development

No branches or pull requests

4 participants