Skip to content

fix(eslint-plugin): [no-unnecessary-type-parameters] skip checking function bodies for AST references #9738

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

Conversation

JoshuaKGoldberg
Copy link
Member

PR Checklist

Overview

Prevents checking of references inside a function body, or if one doesn't exist, generally after the return type.

This might give a little speed boost for not checking function bodies... but:

  • Since that's just AST iteration, it probably won't be noticeable for any real world cases
  • Inferred return types will now have to go to the type checker, which might slow things down anyway

💖

@typescript-eslint
Copy link
Contributor

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.

@JoshuaKGoldberg JoshuaKGoldberg force-pushed the no-unnecessary-type-parameters-body-checking branch from 78dccf3 to 74ebf98 Compare August 6, 2024 19:06
Copy link

netlify bot commented Aug 6, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 78dccf3
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66b2743dc8fc7e00085c9f8f
😎 Deploy Preview https://deploy-preview-9738--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: 95 (no change 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.

@JoshuaKGoldberg JoshuaKGoldberg requested a review from a team August 6, 2024 19:07
Copy link

nx-cloud bot commented Aug 6, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 74ebf98. 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.

Copy link

netlify bot commented Aug 6, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 74ebf98
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/66b2744a3612a60008f4d1d5
😎 Deploy Preview https://deploy-preview-9738--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: 94 (🔴 down 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.

Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

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

bird dancing

Copy link

codecov bot commented Aug 6, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.06%. Comparing base (4366f7f) to head (74ebf98).
Report is 11 commits behind head on main.

Files Patch % Lines
...plugin/src/rules/no-unnecessary-type-parameters.ts 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9738      +/-   ##
==========================================
- Coverage   88.07%   88.06%   -0.02%     
==========================================
  Files         402      402              
  Lines       13693    13697       +4     
  Branches     3982     3985       +3     
==========================================
+ Hits        12060    12062       +2     
- Misses       1324     1325       +1     
- Partials      309      310       +1     
Flag Coverage Δ
unittest 88.06% <66.66%> (-0.02%) ⬇️

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

Files Coverage Δ
...plugin/src/rules/no-unnecessary-type-parameters.ts 94.85% <66.66%> (-1.36%) ⬇️

@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 Aug 12, 2024
@JoshuaKGoldberg JoshuaKGoldberg merged commit fe56157 into typescript-eslint:main Aug 12, 2024
60 of 63 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the no-unnecessary-type-parameters-body-checking branch August 12, 2024 04:12
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 20, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [no-unnecessary-type-parameters] Counts type parameter references in body irrelevant to the signature
2 participants