question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow config extends from actual package-name/path, without mandatory eslint-config or @scope/eslint-config prefix

See original GitHub issue

The version of ESLint you are using. >=6

The problem you want to solve.

I know the problem has already been mentioned twice here, here and also here for plugins but time has passed and I am opening this issue to reconsider the problem in light of an always more modern and integrated ESLint.

Naming things is hard, and having the eslint-config prefix surely helps discoverability. But having tooling configuration all over the place is not beneficial from the developer experience perspective.

My use case here would be to have my organisation various configuration in one package and be able to simply npm install my-org-config and set my various tooling configuration in one place (package.json):

{
  "prettier": "my-org-config/prettier",
  "eslint": {
    "extends": "my-org-config/eslint"
  },
  "stylelint": {
    "extends": "my-org-config/stylelint"
  }
}

I am currently not able to do this for ESLint as either eslint-config or @my-org/eslint-config are required for it to pick up the configuration. Prettier and stylelint allow it.

Your take on the correct solution to problem.

Extends should function more like a require.resolve and don’t make naming rules mandatory. It could still try to resolve “eslint-config-” as fallback to keep consistency, I don’t see any problem with that.

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

Yes although some work seem to have been already started in this PR here from @edahlseng

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nzakascommented, Mar 18, 2020

Thanks for the suggestion. We recently decided to do a complete overhaul of the config system (see the RFC: https://github.com/eslint/rfcs/pull/9), so we aren’t going to be making further changes to the way eslintrc configs are handled.

In the new system, you’ll be able to programmatically load configs from wherever you want.

0reactions
nzakascommented, Mar 31, 2020

This RFC was open for over a year before being accepted: https://github.com/eslint/rfcs/pull/9

It had numerous revisions, was posted on Twitter, and many comments on what would and wouldn’t work. There are links to relevant issues and history of problems in the RFC. I’d suggest reading through that to answer the questions you may have about complexities and motivation.

While I understand that you do not agree with the decision, there was ample opportunity for community input before this decision was made.

As mentioned before, we won’t be making any further changes to the existing config system, so I’m closing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do not require modules with shareable config to be named ...
I'm pretty sure there was a reason for requiring configs to be prefixed with eslint-config- , but I'm not sure what that reason...
Read more >
Configuration Files - ESLint - Pluggable JavaScript Linter
Relative paths and shareable config names in an extends property are resolved from the location of the config file where they appear. The...
Read more >
Angular Eslint config is not extending Project Eslint config
I have an angular 12.x project and it uses eslint, this is the current root configuration file: { "env": { "browser": true, "node":...
Read more >
What is the difference between extends and plugins in ESLint ...
Learn how ESLint works, what are the role of plugins and extends keys in your ESLint config and how they make ESLint an...
Read more >
Migrating and configuring Eslint with Angular 11
[27/02/2021 Update]: Updated ESLint config to work with ... It allows for plugins, different parsers, overrides, extending from others ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found