Skip to content

Bug(type-utils): Node.js' Buffer cannot be matched with a { type: package } TypeOrValueSpecifier #10089

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

Open
4 tasks done
abrahamguo opened this issue Oct 2, 2024 · 1 comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working

Comments

@abrahamguo
Copy link
Contributor

abrahamguo commented Oct 2, 2024

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have searched for related issues and found none that matched my issue.
  • 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) returns undefined
  • 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

  1. clone the repo
  2. npm i
  3. 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
@abrahamguo abrahamguo added bug Something isn't working triage Waiting for team members to take a look labels Oct 2, 2024
@abrahamguo abrahamguo changed the title Bug(type-utils): Buffer cannot be matched with a { type: package } TypeOrValueSpecifier Bug(type-utils): Node.js' Buffer cannot be matched with a { type: package } TypeOrValueSpecifier Oct 2, 2024
@auvred
Copy link
Member

auvred commented Oct 3, 2024

See also #10038

@auvred auvred added accepting prs Go ahead, send a pull request that resolves this issue and removed triage Waiting for team members to take a look labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting prs Go ahead, send a pull request that resolves this issue bug Something isn't working
Projects
None yet
2 participants