typescript-eslint icon indicating copy to clipboard operation
typescript-eslint copied to clipboard

feat(eslint-plugin): [prefer-nullish-coalescing] add support for assignment expressions

Open abrahamguo opened this issue 4 months ago • 4 comments

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 into checkAssignmentOrLogicalExpression
  • [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 consts to declare lets — it is not clear to me why @JoshuaKGoldberg did this in #5234, but I have done it

abrahamguo avatar Oct 15 '24 12:10 abrahamguo