Skip to content

fix(eslint-plugin): [no-confusing-non-null-assertion] check !in and !instanceof #9994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

kirkwaiblinger
Copy link
Member

PR Checklist

Overview

Basically just shares the logic from the other operators. The only difference is that, since it's not always safe to remove the non-null assertion before an in or instanceof, I additionally added the wrapping suggestion for a! in b -> (a!) in b and a! instanceof b -> (a!) instanceof b.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @kirkwaiblinger!

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.

Copy link

netlify bot commented Sep 16, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit e3172b7
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66f0cfd31176bd0008cd5169
😎 Deploy Preview https://deploy-preview-9994--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (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.

@kirkwaiblinger kirkwaiblinger marked this pull request as ready for review September 16, 2024 09:17
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Swell! 🙌

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Sep 16, 2024
@kirkwaiblinger kirkwaiblinger added the enhancement New feature or request label Sep 18, 2024
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.71%. Comparing base (1c183ab) to head (e3172b7).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9994      +/-   ##
==========================================
+ Coverage   88.70%   88.71%   +0.01%     
==========================================
  Files         426      426              
  Lines       14835    14845      +10     
  Branches     4312     4310       -2     
==========================================
+ Hits        13159    13170      +11     
  Misses       1533     1533              
+ Partials      143      142       -1     
Flag Coverage Δ
unittest 88.71% <100.00%> (+0.01%) ⬆️

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

Files with missing lines Coverage Δ
...lugin/src/rules/no-confusing-non-null-assertion.ts 93.54% <100.00%> (+7.83%) ⬆️

@JoshuaKGoldberg JoshuaKGoldberg merged commit 8293546 into typescript-eslint:main Sep 23, 2024
62 checks passed
@kirkwaiblinger kirkwaiblinger deleted the !instanceof branch September 23, 2024 16:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: [no-confusing-non-null-assertion] should check !instanceof
2 participants