typescript-eslint
typescript-eslint copied to clipboard
Bug(type-utils): Node.js' `Buffer` cannot be matched with a `{ type: package }` `TypeOrValueSpecifier`
Before You File a Bug Report Please Confirm You Have Done The Following...
- [X] I have tried restarting my IDE and the issue persists.
- [X] I have updated to the latest version of the packages.
- [X] I have searched for related issues and found none that matched my issue.
- [X] I have read the FAQ and my problem is not listed.
Issue Description
-
Inside
TypeOrValueSpecifier
=>typeDeclaredInDeclarationFile
: - when
declaration.path
is/.../typescript-eslint/node_modules/@types/node/buffer.d.ts
-
program.sourceFileToPackageName.get(declaration.path)
returnsundefined
- thus, causing the specifier
{ from: 'package', name: 'Buffer', package: '...anything...' }
to not match
It looks like this broke in #6870.
Reproduction Repository Link
https://github.com/abrahamguo/repro/tree/buffer
Repro Steps
- clone the repo
-
npm i
-
npx eslint index.ts
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
8.8.0 |
@typescript-eslint/parser |
8.8.0 |
@typescript-eslint/scope-manager |
8.8.0 |
@typescript-eslint/typescript-estree |
8.8.0 |
@typescript-eslint/type-utils |
8.8.0 |
@typescript-eslint/utils |
8.8.0 |
TypeScript |
5.6.2 |
ESLint |
9.11.1 |
node |
22.8.0 |