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
Ability to extend ESLint's own config #3525
Comments
Thanks for the issue! We get a lot of issues, so this message is automatically posted to each one to help you check that you've included all of the information we need to help you. Reporting a bug? Please be sure to include:
Requesting a new rule? Please be sure to include:
Requesting a feature? Please be sure to include:
Including this information in your issue helps us to triage it and get you a response as quickly as possible. Thanks! |
I actually think number 3 is the only viable option. We don't need to worry about breaking changes - that's par for the course with configs. You can always choose to keep using an older version. The larger question to me is how to manage that? I don't want an entirely new repo for our config, as that would make updating it when new rules are added a big pain. |
If we're not concerned with breaking changes, can you explain why 2 wouldn't be viable? Perhaps a publish script in the main repo that grabs the |
Because 2 is an implicit contract saying that Another option would be to have a predefined |
@nzakas Could you explain a bit more why don't you want separate repository? We rarely add new rules to our own .eslintrc file (I think it's not more then once per month or even less). I don't see it as a maintenance burden. |
Having gone through this multiple repository thing a few times, it's something I want to avoid. We just went through the trouble of moving the tester back into this repo, and arguably that had the same update pattern as our What I want is for us to enable every rule possible so we're dogfooding, and that means turning on each new rule when PRs are sent in. Asking people to do a PR to two repositories to get that effect creates too much turbulence. |
Ok, got it. If we want to enable every single rule that changes the equation. |
What's the value of having a separate repo? We could just have another package.json in this one. |
Value is that it's exposed to other people/projects And it would make it easier to use in other repositories of the organization too, since it's just shareable config |
You're talking about the value of publishing the config on npm. We can do that without a separate repo. I'm asking if there's any value to having a separate repo vs. keeping it in this one? |
I wasn't aware that you can do two separate npm packages from the same repository (seems strange to me, since you have to have separate package.json for each). If that's the case, then I can't think of a reason to create separate repository. |
Yup, the coupling is one package.json to one npm package, repos aren't really part of the equation. |
What are the odds we'd run into similar problems with two packages as we'd have with two repositories? That would be a point in favor of the |
Problem with eslint-tester was circular dependency, eslint depended on eslint-tester and eslint-tester depended on eslint. I think that will not be the case with config package. It has no reason to depend on eslint. |
I think the real question is whether or not there's value in having a separate npm package for our config. Doing "ESLint:current" means less for us to manage, but would we be missing any use case? |
True. However in my mind, having "eslint:current" sort of goes against the whole "agenda free" part of the description. We are giving more weight to our own config then others by including it into distribution. |
We also give more weight to our own rules by including them in the distribution. "Agenda free" means we aren't forcing anyone to use something they don't want to use, it says nothing about what we decide to provide as an option. |
It looks like we left this hanging. I, personally, lean more towards having a separate npm package but without a separate repository. Including it as |
I agree. Here's what I have in mind:
Thoughts? |
Sounds good! I'd amend step 4 to check to see if the config has actually changed before doing the release. |
Sounds like a plan! |
Good point. |
Working on this. |
New: Create eslint-config-eslint (fixes #3525)
I am sorry if I resume an old thread. I was wondering why the latest release of I thought step 5 above required publishing a new version, at least when a new release of eslint was released. When I use Am I missing anything? |
In other projects under the eslint org (eslint/eslint-plugin-markdown, for example), I want to adopt the same code conventions used by the core project.
For now, I manually copied the
.eslintrc
from this repository in eslint/eslint-plugin-markdown#8. When theeslint
devDependency
is upgraded, that process will need to be repeated.Could we find a way for projects to use the same config used by eslint core?
Three possible solutions I've come up with so far:
.eslintrc
from the main repository. (Disadvantage: Annoying.).eslintrc
in the npm distribution. (Disadvantage: Enabling or reconfiguring a rule for our own use would then be a breaking change. Could we get around that by making this a private "API" of sorts?)The text was updated successfully, but these errors were encountered: