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.

Feature request: improve how configurations may be extended/loaded from the command line

See original GitHub issue

The version of ESLint you are using. 7.24.0

The problem you want to solve.

I would like to “extend” rules by another set of rules contained in a “shareable configs” (inside a dependent package - https://eslint.org/docs/developer-guide/shareable-configs) from the commandline, like it is possible via package.json:

"eslintConfig": {
        "extends": "plugin:@scope/eslint-plugin/require-types"
}

This way it would be possible to have a set of standard rules when using eslint via editor (eg. VSCode), and use extended rules only on purpose directly from command line or through a package.json script.

Other ways to achieve this don’t seem to work:

  • use “-c”- this needs a “real” file, which “@scope\eslint-config\require-types” is not In case of a single package, “node_modules/@scope/eslint-config/require-types” would work, but not in a workspace. There I would need to include several “…”, which is inflexible and doesn’t work at all for packages that shall be used inside as well as outside a workspace

  • use “–plugin” respects the package (“@scope\eslint-config”), but there appears to be no way for naming the config to be used

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mdjermanoviccommented, Mar 13, 2022

For the context, this feature was supported since ESLint v1.2.0 (https://github.com/eslint/eslint/pull/3063) but then removed in ESLint v6.0.0 (https://github.com/eslint/eslint/pull/11388).

Per this change it looks like the feature was intentionally removed, though I can’t find a mention of it in https://github.com/eslint/rfcs/pull/7.

1reaction
mdjermanoviccommented, Sep 2, 2021

It does work as it seems, but it defeats the purpose of the shared config if every project needs “additional-config.js”.

Yes, if the expectation is that a config package can be used instead of a config file, but the shareable configs feature was not designed for that use case.

https://eslint.org/docs/developer-guide/shareable-configs#using-a-shareable-config

Shareable configs are designed to work with the extends feature of .eslintrc files

So, I think that the lack of CLI options was not an oversight.


This is an interesting feature request, but I’m not sure if we can really evaluate it before implementing the new flat config system. Otherwise, we could end up with a solution that works with eslintrc logic (which will be deprecated at some point), but cannot apply to the new config system.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature Request] Adding additional directory to the config ...
Feature Request I know there's a --config_dir command line argument, that enables to add an additional directory to the config search path.
Read more >
[Feature Request] UniFI Controller Command-line Console
The command-line interface should be able to perform basic operations like. show config; change simple properties (e.g. VLAN ID on a configured network)...
Read more >
create-feature — AWS CLI 1.27.37 Command Reference
Creates an Evidently feature that you want to launch or test. You can define up to five variations of a feature, and use...
Read more >
Product Feature Requests - How to Write and Submit Them
Feature Requests are not a contractual obligation for Qualys to develop the ... Feature request development schedules may change at company discretion ...
Read more >
Feature request, timeout/sleep in configuration jobs
We would like to see an option in the Configuration jobs where we could pause the job for a while as some commands...
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