Skip to content

Bug: @types/node aliased types don't match typeOrValueSpecifier #11504

@kirkwaiblinger

Description

@kirkwaiblinger

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.

Relevant Package

@typescript-eslint/type-utils

Playground Link

https://typescript-eslint.io/play/#ts=5.7.2&showAST=es&fileType=.tsx&code=PTAEBcFMGdwOnNAUASwLYAcD2AncoBvUAExgGMcUAjSUAX1ADMcs1QByAOy1IC4pY7ANxIkpaBWqQAFAEohoEKEB8G4BO90EA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oDN4OBDfMwDmtYtA4BbSshTowAbXDYcAd37QmkADRhlK4HpUrI-eH1UAxDtADSnVUwDK-bogDCZ%2BKgxLjxrH9jSG4JSXlIYn4yAGt%2BYUQdfSCcJn5JRIxIABNyKgAjRO1klMjouISIzly0fBR8SBLjAF8miABdJtaVTohW5qA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

// test.ts
import { describe } from 'node:test';

describe(); // 🫤

ESLint Config

{
  "rules": {
    "@typescript-eslint/no-floating-promises": [
      "warn", 
      { 
        "allowForKnownSafeCalls": [
          {
            "from": "package",
            "name": "describe",
            "package": "node:test"
          }
        ]
      }
    ]
  }
}

tsconfig

{
  "compilerOptions": {
    // ...
  }
}

Expected Result

describe() should not report, due to matching with typeOrValueSpecifier

Actual Result

report on describe()

Additional Info

Followup to #11372 (comment)

cc @Renegade334

Versions

package version
typescript-eslint 8.40.0
@types/node 22.17.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageWaiting for team members to take a look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions