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(noUnusedImports): don't report used val imported as type in an external module #4597

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

Conaclos
Copy link
Member

Summary

Fix #3895

This PR changes how we bind ambient read to imported type.
Previously, we waited to get in the global scope to try binding an ambient read (read of a value in an ambient context) to an import type. However, external modules and namespaces can also import stuff.
I changed the code to support it in any scope.

Test Plan

I added a test

@github-actions github-actions bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Changelog Area: changelog labels Nov 19, 2024
@Conaclos Conaclos requested review from a team November 19, 2024 14:54
@Conaclos Conaclos force-pushed the conaclos/noUnusedImports-3895 branch from ded21c0 to c032141 Compare November 19, 2024 14:55
Copy link
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 48595 48595 0
Passed 47403 47403 0
Failed 1192 1192 0
Panics 0 0 0
Coverage 97.55% 97.55% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6586 6586 0
Passed 2208 2208 0
Failed 4378 4378 0
Panics 0 0 0
Coverage 33.53% 33.53% 0.00%

ts/babel

Test result main count This PR count Difference
Total 680 680 0
Passed 608 608 0
Failed 72 72 0
Panics 0 0 0
Coverage 89.41% 89.41% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18618 18618 0
Passed 14273 14273 0
Failed 4345 4345 0
Panics 0 0 0
Coverage 76.66% 76.66% 0.00%

@Conaclos Conaclos merged commit 50551ff into main Nov 20, 2024
11 checks passed
@Conaclos Conaclos deleted the conaclos/noUnusedImports-3895 branch November 20, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-Linter Area: linter L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💅 noUnusedImports warns used types in declaring modules
1 participant