Skip to content

Add a flag to disable computing full configurations #746

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

Closed
JoshuaKGoldberg opened this issue Oct 11, 2020 · 5 comments
Closed

Add a flag to disable computing full configurations #746

JoshuaKGoldberg opened this issue Oct 11, 2020 · 5 comments
Labels
area: lint configurations Improving settings placed into lint configurations outside of rules. type: enhancement New feature or request

Comments

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Oct 11, 2020

🚀 Feature Request

Some configurations, particularly those for monorepos, don't need to compute the full/extended config for a conversion. Their configurations might exist solely to modify a few choice rules from an extended shared config.

{
  "extends": "@org/eslint-config",
  "rules": {
    "specific-rule": "error"
  }
}

Existing Behavior

There's no way to change the behavior of rule conversions to ignore extended configurations.

Change Proposal

How about a --standalone flag / standalone Node API (once #732 is resolved) to disable fetching and computing the --print-config and extends rules for lint configurations? Is there a better name for the flag?

In the above example, instead of factoring in @org/eslint-config, we'd only look at rules -> specific-rule.

@JoshuaKGoldberg JoshuaKGoldberg added area: lint configurations Improving settings placed into lint configurations outside of rules. status: in discussion This issue needs more discussion before code changes type: enhancement New feature or request labels Oct 11, 2020
@JoshuaKGoldberg
Copy link
Member Author

@JamesHenry it'd be good, too, to know if this should change how the lint configurations for workspaces are printed out. E.g. should we skip adding in any "extends", "plugins", etc. metadata other than "rules"?

@JamesHenry
Copy link
Member

Hmm yeah I guess in my monorepo use-case a nested project/package config could extend other unique things that you would want to take into account...

So maybe rather than a flag, what we what is to be able to specify particular paths within extends that should be ignored for a particular config. The outer tooling can figure out the path to the root config and instruct the library to ignore any extends references to that?

I don’t think skipping plugins etc would be part of my use-case, we would want to always consider those

@JoshuaKGoldberg
Copy link
Member Author

JoshuaKGoldberg commented Oct 11, 2020

Super interesting. Are there any workspaces/configs you could post as examples @JamesHenry?

@JamesHenry
Copy link
Member

Great to catch up with you today - as briefly mentioned on slack after our call, I think I personally no longer need this in light of the changes we discussed to the available Node APIs - I will be able to customize the extends however I need to before ever passing it to the library!

@JoshuaKGoldberg
Copy link
Member Author

If anybody is still interested in this, comment below and we can re-open!

@JoshuaKGoldberg JoshuaKGoldberg removed the status: in discussion This issue needs more discussion before code changes label Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: lint configurations Improving settings placed into lint configurations outside of rules. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants