Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Labels
Milestone
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I havesearched for related issues and found none that match my proposal.
- I have searched thecurrent rule list and found no rules that match my proposal.
- I haveread the FAQ and my problem is not listed.
Relevant Package
ast-spec
My proposal is suitable for this project
- I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).
Description
From#4436 (comment): when checking whether a'package' matches inTypeOrValueSpecifier.ts, we check whether the declaration file name includesspecifier.package directly:
typescript-eslint/packages/type-utils/src/TypeOrValueSpecifier.ts
Lines 170 to 176 in346fdbc
| returndeclarationFiles.some( | |
| declaration=> | |
| declaration.fileName.includes(`node_modules/${specifier.package}/`)|| | |
| declaration.fileName.includes( | |
| `node_modules/@types/${specifier.package}/`, | |
| ), | |
| ); |
This is a potential issue because package names with@ in them have a__ replacing the@. And there might be other replacements I'm not remembering - haven't looked deeply into it.
We should handle any name substitutions in npm packages well, and add unit tests for it inTypeOrValueSpecifier.test.ts.
Fail
n/a
Pass
n/a
Additional Info
No response