JS-2207: Implement S9135: Avoid mutating nested properties of shallow clones - #7706
JS-2207: Implement S9135: Avoid mutating nested properties of shallow clones#7706nathsou wants to merge 3 commits into
Conversation
Ruling ReportNew issues flagged (2 issues)S9135 23 |
24 | const lodashCopy = lodash.clone(user);
> 25 | lodashCopy.address.city = 'Geneva';
26 |
27 | const underscoreCopy = underscore.clone(user); 26 |
27 | const underscoreCopy = underscore.clone(user);
> 28 | underscoreCopy.address.city = 'Geneva';
29 |
30 | const deepCopy = structuredClone(user);Ruling passed with these expected-result updates already present in the branch. No fix PR was needed. |
This comment has been minimized.
This comment has been minimized.
|
Code Review ✅ Approved 2 resolved / 2 findingsImplements rule S9135 to detect nested property mutations on shallow clones from Lodash and Underscore.js, addressing the stray copyright header and hardcoded diagnostic message findings. ✅ 2 resolved✅ Quality: Stray Closure Library copyright header in test fixture
✅ Quality: Diagnostic message hardcodes '_.clone()' for all import forms
OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |




Summary
cloneresults.structuredClone()and intentional-shared-stateNOSONARsuggestions, with library-specific messages for Lodash and Underscore.js.Links