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: operator-assignment should indicate which operator can be shortened #14764

Merged
merged 1 commit into from Jul 10, 2021

Conversation

paulsmithkc
Copy link
Contributor

@paulsmithkc paulsmithkc commented Jul 2, 2021

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an 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?

operator-assignment

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.)?

new default behavior

Please provide some example code that this change will affect:

x = x + 3;

What does the rule currently do for this code?

Current error message: "Assignment can be replaced with operator assignment."

What will the rule do after it's changed?

New error message: "Assignment (=) can be replaced with operator assignment (+=)."

What changes did you make? (Give an overview)

  1. Introduced an "operator" token that can be used in the error message.
  2. Updated the error messages to use this token.

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

Are there any other ways to make this error message less cryptic?

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Jul 2, 2021
Copy link
Member

@nzakas nzakas 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.

@nzakas nzakas added accepted There is consensus among the team that this change meets the criteria for inclusion enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Jul 9, 2021
Copy link
Contributor

@snitin315 snitin315 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!

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

This is a nice improvement!

@btmills btmills merged commit ddffa8a into eslint:master Jul 10, 2021
@paulsmithkc paulsmithkc deleted the operator-assignment branch July 11, 2021 15:49
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jan 7, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jan 7, 2022
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

4 participants