-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Update: disallow multiple options in comma-dangle schema (fixes #13165) #13166
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
Conversation
I slightly suggest it to be a breaking change, but will follow the team's consensus. plus, I noticed quite a few rules didn't have the option(e.g.arrow-body-style), do we want to "fix" the issue in all other rules? |
I think we should fix this if there is a similar problem in other rules, but Some rules have |
I think it would be good to add these check-in internal-rule to go through to the WDYT ? |
It might be interesting to check this and maybe open a separate issue. I'd expect that the vast majority of A simple search by 4 objects have something different as The absence of |
yes,. about those rules not having this set, I think those object types having no |
@mdjermanovic I have created a bit of rule to check for the
I think I might have missed some cases. |
@anikethsaha I found that rules that don't have |
9f7febb
to
00c2733
Compare
@aladdin-add it's now changed to I'm not sure if this should be treated as a breaking change, but it indeed seems like a change that requires a semver-minor release rather than a patch. |
there was a similar case: 2d32a9e -- it was treated as a breaking change. |
I marked this as accepted since I believe this is a bug that should be fixed, but there's still open question on how to treat this: semver-minor or breaking. |
I think this should be treated as a semver-minor bug fix. |
Thanks for contributing! |
Heads up: this was a breaking change in eslint v7.3. This should be reverted, or fixed ASAP so the object can be used in conjunction with the string. |
Specifically, I'm confused why the choice was made to break users who have a perfectly valid and precedented expectation (that the string sets the default, and the object provides granular overrides for it) rather than fixing the rule to match that expectation. |
I think we should have a discussion about whether or not this kind of changes requires a major version, and maybe update the semver policy with this detail. |
@mdjermanovic being undocumented isn’t license to break it in a nonmajor. Either way, this is breaking a few of my packages that were previously working fine with this setting (there’s other rules that work this way), so I’d appreciate a revert or a proper fix so it does work this way :-) |
But the revert wouldn't do any good for those packages, you would still have to change the config since it doesn't work as it was expected when the config was made? |
That doesn't matter - this PR caused the CI job for linting to fail where it previously succeeded. Additionally, in the case I'm worried about, it's actually always worked correctly, because my string is the same value as "every RHS of the object". |
- eslint TODO due to eslint/eslint#13166 (comment), breaking change in eslint v7.3
Added an item for discussion eslint/tsc-meetings#198 (comment) |
To keep you up to date @ljharb, after today's TSC meeting, we're updating our semver policy to include rule schemas as part of the public API, for which incompatible changes are semver-major. While we don't currently have the infrastructure to patch the previous minor version where this was first released, we're reverting this change as part of this weekend's release. |
@btmills thank you all for the decision, the followup, and the revert. |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[X] Bug fix
fixes #13165
comma-dangle
schema mistakenly allows specifying multiple options.User might expect that this rule allows string option + specific overrides in an additional object option, because some other rules indeed have such configuration.
What changes did you make? (Give an overview)
Added
additionalItems: false
in order to allow specifying only 1 option.Is there anything you'd like reviewers to focus on?
This change can break a build with an invalid configuration, which should be a good thing since it wasn't working as expected.
A similar change was treated as a semver-patch bug fix (#12639).