Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

chore: add more cases to noSelfAssign #4672

Merged
merged 1 commit into from
Jul 9, 2023
Merged

Conversation

ematipico
Copy link
Contributor

Summary

Closes #3980

I added more coverage to the cases deemed invalid.

Test Plan

I added more test cases.

@netlify
Copy link

netlify bot commented Jul 9, 2023

Deploy Preview for docs-rometools failed.

Name Link
🔨 Latest commit 7a470b2
🔍 Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/64aa910be7faff0008147a08

@github-actions github-actions bot added the A-Linter Area: linter label Jul 9, 2023
@@ -318,8 +327,15 @@ impl SameIdentifiers {
))
.is_some()
{
return Some(AnyAssignmentLike::Identifiers(identifier_like));
let source_identifier = IdentifiersLike::try_from((
Copy link
Contributor Author

@ematipico ematipico Jul 9, 2023

Choose a reason for hiding this comment

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

There was a bug where the rule wasn't flagging the "last" identifier of the assignment expression.
Now the rule, in a case like a.b.c = a.b.c; correctly highlights c.

@ematipico ematipico merged commit 38987c2 into main Jul 9, 2023
@ematipico ematipico deleted the feat/no-self-assign branch July 9, 2023 12:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Linter Area: linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

noSelfAssign, no-self-assign
2 participants