Skip to content

feat(eslint-plugin): [no-unused-vars] add reportUnusedIgnorePattern option #9324

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 1 commit into from
Jun 25, 2024

Conversation

bradzacher
Copy link
Member

PR Checklist

Overview

This was added upstream in eslint/eslint#17662
This syncs the changes to our implementation.

@bradzacher bradzacher added the enhancement New feature or request label Jun 11, 2024
@bradzacher bradzacher added this to the 8.0.0 milestone Jun 11, 2024
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

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 Jun 11, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 73009bc
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6667cfe835bbf10008bb33e0
😎 Deploy Preview https://deploy-preview-9324--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 (🔴 down 3 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.

Comment on lines -672 to -677
// define the enum name again inside the new enum scope
// references to the enum should not resolve directly to the enum
this.currentScope().defineIdentifier(
node.id,
new TSEnumNameDefinition(node.id, node),
);
Copy link
Member Author

Choose a reason for hiding this comment

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

Previously we added an enum name variable within the enum scope.
This was a laziness thing in part to ensure that recursive references didn't prevent unused variable checks.
I have aligned enums with functions and namespaces and removed this check and instead we rely on an explicit "is recursive" check (see changes to collectUnusedVariables.ts)

Copy link

nx-cloud bot commented Jun 11, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 73009bc. 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 1 target

Sent with 💌 from NxCloud.

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

Attention: Patch coverage is 95.60440% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.44%. Comparing base (3c3370f) to head (73009bc).
Report is 23 commits behind head on v8.

Additional details and impacted files
@@           Coverage Diff           @@
##               v8    #9324   +/-   ##
=======================================
  Coverage   87.44%   87.44%           
=======================================
  Files         387      387           
  Lines       13193    13238   +45     
  Branches     3824     3841   +17     
=======================================
+ Hits        11536    11576   +40     
- Misses       1358     1360    +2     
- Partials      299      302    +3     
Flag Coverage Δ
unittest 87.44% <95.60%> (+<0.01%) ⬆️

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

Files Coverage Δ
...kages/eslint-plugin/src/rules/naming-convention.ts 94.50% <100.00%> (ø)
...s/eslint-plugin/src/util/collectUnusedVariables.ts 93.41% <100.00%> (+0.28%) ⬆️
...ackages/scope-manager/src/referencer/Referencer.ts 95.51% <ø> (-0.02%) ⬇️
packages/scope-manager/src/variable/index.ts 80.00% <ø> (ø)
packages/utils/src/ts-eslint/Scope.ts 80.00% <ø> (ø)
packages/eslint-plugin/src/rules/no-unused-vars.ts 97.43% <93.93%> (-1.31%) ⬇️

... and 1 file with indirect coverage changes

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.

🚀

@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 Jun 24, 2024
@bradzacher bradzacher merged commit b8d1d39 into v8 Jun 25, 2024
65 of 66 checks passed
@bradzacher bradzacher deleted the no-unused-vars-v9 branch June 25, 2024 04:45
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 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-unused-vars] Support for ignoreClassWithStaticInitBlock and reportUsedIgnorePattern Options
2 participants