Skip to content
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

Update: Rename and deprecate misnamed option #9570

Merged
merged 1 commit into from Jan 8, 2018
Merged

Update: Rename and deprecate misnamed option #9570

merged 1 commit into from Jan 8, 2018

Conversation

jrpool
Copy link
Contributor

@jrpool jrpool commented Nov 3, 2017

Object option allowMultiplePropertiesPerLine is stricter than the name implies.
It creates an exception to object-property-newline only if ALL properties are
on a SINGLE line. Renamed accordingly. Old name left deprecated, and 2 tests with
deprecated name (1 valid and 1 invalid) left in force.

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[X] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What rule do you want to change?
object-property-newline

Does this change cause the rule to produce more or fewer warnings?
No.

How will the change be implemented? (New option, new default behavior, etc.)?
Replacement of old property name with new one, except that old name remains as deprecated and is still (rudimentarily) tested for.

Please provide some example code that this change will affect:

const object = {a: 1, b: 2, c: 3};

What does the rule currently do for this code?
Permits it if object-property-newline is enabled, but only if its allowMultiplePropertiesPerLine option is set to true.

What will the rule do after it's changed?
Permit it if object-property-newline is enabled, but only if either its allowMultiplePropertiesPerLine option or its allowAllPropertiesOnSameLine option is set to true.

What changes did you make? (Give an overview)
Documented the allowMultiplePropertiesPerLine option as deprecated and added 2 tests for that option. Otherwise, changed that option throughout to allowAllPropertiesOnSameLine.

Is there anything you'd like reviewers to focus on?

Copy link
Member

@aladdin-add aladdin-add left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I think it should be Update, instead of Chore. 😄

@aladdin-add aladdin-add added enhancement This change enhances an existing feature of ESLint evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion rule Relates to ESLint's core rules and removed chore This change is not user-facing labels Nov 4, 2017
@jrpool
Copy link
Contributor Author

jrpool commented Nov 4, 2017

Thanks, @aladdin-add. The Developer Guide says the Update tag is for “a backwards-compatible enhancement or a change to a rule that increases the number of reported problems”. Does a change like this increase the number of reported problems? If not, do you think that the description of Update is not correct?

@ilyavolodin
Copy link
Member

@jrpool Chore is usually for internal tasks that have no affect on the end product. Like adding additional unit tests, refactoring, etc. This is an update to a rule, that adds a new option. It's backwards compatibly, since it preserves the old option, but it still introduces new option to the rule, so it should be marked as Update. Second part of the description of the update tag is not necessary (as in, update can introduce more errors, but doesn't have to).

@platinumazure
Copy link
Member

@jrpool That description is grammatically ambiguous but I think it's supposed to read like this: "a backwards-compatible enhancement, or a change to a rule that increases the number of reported problems". This change is the first... Make sense?

@jrpool jrpool changed the title Chore: Rename and deprecate misnamed option Update: Rename and deprecate misnamed option Nov 4, 2017
Object option allowMultiplePropertiesPerLine is stricter than the name implies.
It creates an exception to object-property-newline only if ALL properties are
on a SINGLE line. Renamed accordingly. Old name left deprecated, and 2 tests with
deprecated name (1 valid and 1 invalid) left in force.
@jrpool
Copy link
Contributor Author

jrpool commented Nov 4, 2017

Thank you, @ilyavolodin and @platinumazure. I suspected that ambiguity but thought the most natural interpretation was with the qualifier modifying both alternatives. I have amended the description of this PR and the heading of the commit. I can submit another PR disambiguating the tag definition in the developer doc.

Copy link
Member

@platinumazure platinumazure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! We just need to evaluate the overall proposal, hopefully we can get that done soon.

@platinumazure platinumazure self-assigned this Jan 6, 2018
@platinumazure
Copy link
Member

I'll champion this.

@eslint/eslint-team Can we please evaluate this proposal? The object option is currently misnamed and it would be good to address this (in a backwards compatible manner, of course).

@ilyavolodin @aladdin-add Since you approved the PR, are you willing to 👍 the proposal?

@kaicataldo
Copy link
Member

@eslint/eslint-team We just need one more 👍

@platinumazure
Copy link
Member

Marking as accepted (champion: me, 👍s: ilyavolodin, kaicataldo, mysticatea).

@platinumazure platinumazure added accepted There is consensus among the team that this change meets the criteria for inclusion and removed evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jan 8, 2018
Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for contributing to ESLint!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants