Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Bug: [no-floating-promises] allowForKnownSafeCalls no longer works fordescribe function with newer node:test typings #11372

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin
@kayahr

Description

@kayahr

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 havesearched for related issues and found none that matched my issue.
  • I haveread the FAQ and my problem is not listed.

Playground Link

https://typescript-eslint.io/play/#ts=5.8.2&fileType=.tsx&code=JYWwDg9gTgLgBAbzgEwKYGcDGVgCNUA0cw8AvnAGZQQhwBEAdhGgFwwYx0BQXaWO%2BABR0KECHSKCAlHAC8APkRc4xGMNwBDKBLjS5ihMrikpAbi4nzXIA&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6Jge1oDN4OBDfMwDmtYtA4BbSshTowAbXDYcAd37QmkADSZlKnP3h9VAMQ7QA0p1VMAyv26IAwkfioMSgwazeDkbglJeUhifjIAa35hRB19PxwmfklYzyhKfB0oABNyKgAjWN1IfBRM4uRYDNiwAF1teITQ8KiYkM5ctFLkTMaDAF8%2BiFq%2BwZURiEH%2BoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false

Repro Code

import{describe,it}from"node:test"describe("foo",()=>{it("bar",()=>{});});

ESLint Config

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

tsconfig

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

Expected Result

The floating-promise warning should be ignored fordescribe andit calls fromnode:test.

Actual Result

Since@types/node version 24.0.9 it only works forit but no longer fordescribe. With version 24.0.8 it works for both calls.

Additional Info

In@types/node version 24.0.8 theit anddescribe functions were exported directly. Since 24.0.9 the functions are exported as an alias:

namespacetest{export{test};export{suiteasdescribe,testasit};}// ...export=test;

Theit function only works when I also add thetest function in theallowForKnownSafeCalls config. But addingsuite doesn't fix the problem withdescribe.

The export definitions in@types/node are syntactically correct, no compiler and runtime errors. So I guess this is a bug intypescript-eslint that these definitions are not parsed correctly?

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp