-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: type-utilsIssues related to the @typescript-eslint/type-utils packageIssues related to the @typescript-eslint/type-utils package
Milestone
Description
Before You File a Proposal Please Confirm You Have Done The Following...
- I have searched for related issues and found none that match my proposal.
- I have searched the current rule list and found no rules that match my proposal.
- I have read 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 in TypeOrValueSpecifier.ts
, we check whether the declaration file name includes specifier.package
directly:
typescript-eslint/packages/type-utils/src/TypeOrValueSpecifier.ts
Lines 170 to 176 in 346fdbc
return declarationFiles.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 in TypeOrValueSpecifier.test.ts
.
Fail
n/a
Pass
n/a
Additional Info
No response
marekdedic
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: type-utilsIssues related to the @typescript-eslint/type-utils packageIssues related to the @typescript-eslint/type-utils package