-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat(eslint-plugin): add no-unnecessary-type-constraint
rule
#2516
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): add no-unnecessary-type-constraint
rule
#2516
Conversation
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. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day. |
e0ee9ae
to
23e14f2
Compare
Codecov Report
@@ Coverage Diff @@
## master #2516 +/- ##
==========================================
- Coverage 92.81% 92.75% -0.07%
==========================================
Files 290 296 +6
Lines 9453 9739 +286
Branches 2647 2733 +86
==========================================
+ Hits 8774 9033 +259
- Misses 322 332 +10
- Partials 357 374 +17
Flags with carried forward coverage won't be shown. Click here to find out more.
|
23e14f2
to
592e282
Compare
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.
the logic itself LGTM - a few minor comments.
Thanks for working on this
packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
Outdated
Show resolved
Hide resolved
packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts
Outdated
Show resolved
Hide resolved
no-unnecessary-type-constraint
rule
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.
one last minor comment then we're good to go!
Fixes #2107.
If a type parameter inside a type parameter declaration includes a constraint and that constraint includes the
Any
orUnknown
flag, that's an error.