Open
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 have searched for related issues and found none that matched my issue.
- I have read 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
Expected Result
The floating-promise warning should be ignored for describe
and it
calls from node:test
.
Actual Result
Since @types/node
version 24.0.9 it only works for it
but no longer for describe
. With version 24.0.8 it works for both calls.
Additional Info
In @types/node
version 24.0.8 the it
and describe
functions were exported directly. Since 24.0.9 the functions are exported as an alias:
namespace test {
export { test };
export { suite as describe, test as it };
}
// ...
export = test;
The it
function only works when I also add the test
function in the allowForKnownSafeCalls
config. But adding suite
doesn't fix the problem with describe
.
The export definitions in @types/node
are syntactically correct, no compiler and runtime errors. So I guess this is a bug in typescript-eslint
that these definitions are not parsed correctly?