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 1 year 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

Thanks for the PR, @abrahamguo!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


πŸ™ Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint.

typescript-eslint[bot] avatar Oct 15 '24 12:10 typescript-eslint[bot]

Deploy Preview for typescript-eslint ready!

Name Link
Latest commit 22841dac7a89680ddb4d4fc679205f3a2543495d
Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/671698d6a3b5760008057386
Deploy Preview https://deploy-preview-10152--typescript-eslint.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 97 (🟒 up 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Oct 15 '24 12:10 netlify[bot]

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 22841dac7a89680ddb4d4fc679205f3a2543495d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

πŸ“‚ See all runs for this CI Pipeline Execution


βœ… Successfully ran 2 targets

Sent with πŸ’Œ from NxCloud.

nx-cloud[bot] avatar Oct 15 '24 12:10 nx-cloud[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.16%. Comparing base (c8e7c27) to head (22841da). Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10152      +/-   ##
==========================================
- Coverage   86.18%   86.16%   -0.02%     
==========================================
  Files         430      430              
  Lines       15029    15031       +2     
  Branches     4360     4361       +1     
==========================================
- Hits        12952    12951       -1     
- Misses       1725     1728       +3     
  Partials      352      352              
Flag Coverage Ξ”
unittest 86.16% <100.00%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Ξ”
...lint-plugin/src/rules/prefer-nullish-coalescing.ts 97.70% <100.00%> (-2.30%) :arrow_down:
packages/rule-tester/src/utils/config-validator.ts 27.41% <100.00%> (ΓΈ)
packages/type-utils/src/TypeOrValueSpecifier.ts 100.00% <ΓΈ> (ΓΈ)
packages/type-utils/src/builtinSymbolLikes.ts 4.91% <ΓΈ> (ΓΈ)
.../src/typeOrValueSpecifiers/specifierNameMatches.ts 100.00% <ΓΈ> (ΓΈ)

codecov[bot] avatar Oct 16 '24 04:10 codecov[bot]

I'd switched from const to let for consistency, I think. Not a major preference.

JoshuaKGoldberg avatar Oct 21 '24 15:10 JoshuaKGoldberg