-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): [restrict-plus-operands] add allow* options #6161
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
feat(eslint-plugin): [restrict-plus-operands] add allow* options #6161
Conversation
… restrict-template-expressions
Thanks for the PR, @JoshuaKGoldberg! 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. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
||
if (types.some(value => value === 'bigint')) { | ||
return 'bigint'; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three inner if (types.some(...
cases weren't covered by code coverage. Most of the intersections in the previous test suite reduced to never
. I got rid of most of them.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6161 +/- ##
==========================================
+ Coverage 91.26% 91.31% +0.04%
==========================================
Files 366 366
Lines 12427 12426 -1
Branches 3639 3644 +5
==========================================
+ Hits 11342 11347 +5
+ Misses 774 768 -6
Partials 311 311
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Drafting this pending discussion in #6110 |
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Checklist
Overview
Brings in the
allowBoolean
,allowNullish
, andallowRegExp
options from@typescript-eslint/restrict-template-expressions
. Also adds anallowNumberWithString
option equivalent to theallowNumber
option, as a more-specific-to-this-rule name.Internally streamlines the rule a bit by having comparisons directly refer to
ts.TypeFlags
checks whenever possible.