typescript-eslint
typescript-eslint copied to clipboard
feat(eslint-plugin): [prefer-nullish-coalescing] add support for assignment expressions
PR Checklist
- [x] Addresses an existing open issue: fixes #10145
- [x] That issue was marked as accepting prs
- [x] Steps in Contributing were taken
Overview
Re-applies #5234, while accounting for updates made since to prefer-nullish-coalescing
.
Commits:
- [x] Extracted the current logic of the
LogicalExpression
listener intocheckAssignmentOrLogicalExpression
- [x] Pulled in other changes to rule file, as well as updates to
checkAssignmentOrLogicalExpression
to support assignments - [x] ported over test cases and updates to test case generation functions
- [x] changed all
declare const
s todeclare let
s — it is not clear to me why @JoshuaKGoldberg did this in #5234, but I have done it