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

Fix: no-param-reassign - ignore parameter used as condition in ternary operator #11239

Merged
merged 1 commit into from Jan 4, 2019

Conversation

Projects
None yet
4 participants
@zhouhaoyu
Copy link
Contributor

zhouhaoyu commented Jan 4, 2019

What is the purpose of this pull request?

What changes did you make? (Give an overview)

Added case of ConditionalExpression (ternary operator) in rule no-param-reassign when checking modification to parameters.

Parameter used in condition of ternary operator will now be ignored.

(arg ? a : b).c = 3; should no longer trigger the rule.

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

@eslint eslint bot added the triage label Jan 4, 2019

@zhouhaoyu zhouhaoyu force-pushed the zhouhaoyu:issue11236 branch from 8e51f1d to f19ac5a Jan 4, 2019

@zhouhaoyu zhouhaoyu force-pushed the zhouhaoyu:issue11236 branch from f19ac5a to 392077e Jan 4, 2019

@not-an-aardvark not-an-aardvark added bug rule accepted and removed triage labels Jan 4, 2019

@not-an-aardvark
Copy link
Member

not-an-aardvark left a comment

Looks good to me, thanks!

@platinumazure
Copy link
Member

platinumazure left a comment

LGTM, thanks!

@btmills

btmills approved these changes Jan 4, 2019

Copy link
Member

btmills left a comment

LGTM, thank you!

@not-an-aardvark not-an-aardvark merged commit bfff77a into eslint:master Jan 4, 2019

5 checks passed

commit-message Commit message follows guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details
@zhouhaoyu

This comment has been minimized.

Copy link
Contributor

zhouhaoyu commented Jan 5, 2019

Glad it helped 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment