Closed njoyard closed 2 years ago
Currently, prefer-destructuring is always enforced.
prefer-destructuring
// Incorrect let foo = obj.foo let bar = obj.foo bar = obj.foo // Correct let { foo } = obj let { foo: bar } = obj ;({ foo: bar } = obj)
The last correct line is neither nice nor easy to read. This PR proposes relaxing the rule for assignments, leaving it on for declarations only:
// Incorrect let foo = obj.foo let bar = obj.foo // Correct let { foo } = obj let { foo: bar } = obj bar = obj.foo
Currently,
prefer-destructuring
is always enforced.The last correct line is neither nice nor easy to read. This PR proposes relaxing the rule for assignments, leaving it on for declarations only: