Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

new rule no-parameter-reassignment #3045

Merged
merged 5 commits into from Aug 14, 2017
Merged

new rule no-parameter-reassignment #3045

merged 5 commits into from Aug 14, 2017

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented Jul 14, 2017

PR checklist

Overview of change:

[new-rule] no-parameter-reassignment
Fixes: #3033
/cc @benny-medflyt

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

CHANGELOG.md entry:

[new-rule] `no-parameter-reassign`
Fixes: #3033
@benny-medflyt
Copy link

Looks awesome 🥇

I can't quite tell from the code... what did you end up deciding regarding destructured parameters?
I personally think that when this rule is enabled, they should also be affected and prevented from being re-assigned

@ajafff
Copy link
Contributor Author

ajafff commented Jul 16, 2017

@benny-medflyt I decided to also check destructured parameters. I don't think it's necessary to add an option to disable that behavior until there is demand for it.

Copy link
Contributor

@adidahiya adidahiya left a comment

Choose a reason for hiding this comment

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

code looks good, but can you please rename this to no-parameter-reassignment? we have a few existing rules that don't use the "reassign" abbreviation, so I'd like to stick to the convention of using the full word.

@ajafff
Copy link
Contributor Author

ajafff commented Aug 14, 2017

Renamed as suggested and fixed merge conflicts

@adidahiya adidahiya changed the title new rule no-parameter-reassign new rule no-parameter-reassignment Aug 14, 2017
@zheeeng
Copy link

zheeeng commented Sep 6, 2017

I think it is acceptable reassigning params which its type is number, string, boolean. It helps to write some algorithms easy.

HyphnKnight pushed a commit to HyphnKnight/tslint that referenced this pull request Apr 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule suggestion: disallow modifying function parameters
4 participants