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: Improving no-mixed-operators to clarify what changes need to be made. #14765

Merged
merged 1 commit into from Jul 9, 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?

no-mixed-operators

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:

const result = investment * rate / 100;

What does the rule currently do for this code?

Current error message: "Unexpected mix of '*' and '/'."

What will the rule do after it's changed?

New error message: "Unexpected mix of '*' and '/'. Use parentheses to clarify the intended order of operations."

What changes did you make? (Give an overview)

Updated the error message for no-mixed-operators to clarify what changes need to made.

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

Is there anything else that would make this error message clearer?

Copy link
Contributor

@snitin315 snitin315 left a comment

I'm okay with change, it makes sense to me to provide a more helpful message. Let's wait for other team members to review this change.

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Makes sense to me, LGTM!

@nzakas nzakas merged commit bba714c into eslint:master Jul 9, 2021
14 checks passed
@paulsmithkc paulsmithkc deleted the no-mixed-operators branch Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants