Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
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
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?