Skip to content
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

fix(eslint-plugin): [no-unused-vars] check if any variable definition is exported #6873

Merged
merged 6 commits into from Jul 17, 2023

Conversation

Maxim-Mazurok
Copy link
Contributor

PR Checklist

Overview

As per #6188 (comment) suggestion, instead of checking the first declaration of a variable to determine if it's exported or not, I'm checking all declarations. Test included.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @Maxim-Mazurok!

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.

@netlify
Copy link

netlify bot commented Apr 9, 2023

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 167de44
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/64b482443f62670008849856
😎 Deploy Preview https://deploy-preview-6873--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Maxim-Mazurok Maxim-Mazurok changed the title Fix #6188 - check if any variable definition is exported fix(eslint-plugin): [no-unused-vars] check if any variable definition is exported Apr 9, 2023
@nx-cloud
Copy link

nx-cloud bot commented Apr 9, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 167de44. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 35 targets

Sent with 💌 from NxCloud.

@codecov
Copy link

codecov bot commented Apr 9, 2023

Codecov Report

Merging #6873 (167de44) into main (a9d7bb1) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6873      +/-   ##
==========================================
- Coverage   87.47%   87.47%   -0.01%     
==========================================
  Files         379      379              
  Lines       13230    13228       -2     
  Branches     3906     3905       -1     
==========================================
- Hits        11573    11571       -2     
  Misses       1279     1279              
  Partials      378      378              
Flag Coverage Δ
unittest 87.47% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...s/eslint-plugin/src/util/collectUnusedVariables.ts 93.10% <100.00%> (-0.06%) ⬇️

... 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.

Super, thanks! Implementation looks great 🙌 - just requesting changes on a teeny bit more testing (unless I missed it already existing?).

@JoshuaKGoldberg JoshuaKGoldberg added the awaiting response Issues waiting for a reply from the OP or another party label Apr 9, 2023
@bradzacher bradzacher added the bug Something isn't working label Apr 10, 2023
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.

Super, thanks @Maxim-Mazurok! This looks clean and great. And the extra tests are always lovely, much appreciated!

Aside - my apologies for taking so long without getting back to you. I got sidetracked during the v6 work and dropped priority on the PR queue. But I should have let you know (or, honestly, just reviewed this PR - it's a pretty straightforwardly great one). Sorry about that!

packages/eslint-plugin/src/util/collectUnusedVariables.ts Outdated Show resolved Hide resolved
@JoshuaKGoldberg JoshuaKGoldberg removed the awaiting response Issues waiting for a reply from the OP or another party label Jul 16, 2023
@JoshuaKGoldberg JoshuaKGoldberg merged commit 587ac30 into typescript-eslint:main Jul 17, 2023
48 of 50 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: [no-unused-vars] false positive if name is type/value merged and exported
3 participants