tools icon indicating copy to clipboard operation
tools copied to clipboard

feat(rome_js_analyze): `noAssignInExpressions`

Open Conaclos opened this issue 1 year ago • 7 comments

Summary

This is an exclusive rule for Rome! This disallows any assignment in an expression.

This covers two ESLint's rules: no-cond-assign and no-return-assign.

Implemenattion alternatives

The rule could be relaxed to allow assignment of assignment such as:

let a, b;
a = b = 5;

and void-assign:

let a;
void (a = 5);

I could keep the rule as is and open an issue to gather interest.

Test Plan

Unit tests and doc tests included.

Conaclos avatar Dec 03 '22 17:12 Conaclos