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

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

Merged
merged 1 commit into from Jan 4, 2019

Conversation

lpaladin
Copy link
Contributor

@lpaladin lpaladin 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-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Jan 4, 2019
@not-an-aardvark not-an-aardvark added bug ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Jan 4, 2019
Copy link
Member

@not-an-aardvark not-an-aardvark left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks!

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!

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.

LGTM, thank you!

@not-an-aardvark not-an-aardvark merged commit bfff77a into eslint:master Jan 4, 2019
@lpaladin
Copy link
Contributor Author

lpaladin commented Jan 5, 2019

Glad it helped 😄

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jul 4, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jul 4, 2019
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 bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assignment to ternary expression using function parameter as condition triggers no-param-reassign
4 participants