-
-
Notifications
You must be signed in to change notification settings - Fork 950
linter: typescript/no-floating-promises doesn't work with sample code #13669
Copy link
Copy link
Closed
Labels
A-linterArea - LinterArea - Linter
Description
What version of Oxlint are you using?
1.14.0
What command did you run?
bunx oxlint --deny typescript/no-floating-promises test.ts
What does your .oxlintrc.json config file look like?
What happened?
I pasted the sample incorrect code into test.ts:
const promise = new Promise((resolve, reject) => resolve("value"));
promise;
async function returnsPromise() {
return "value";
}
returnsPromise().then(() => {});
Promise.reject("value").catch();
Promise.reject("value").finally();
[1, 2, 3].map(async x => x + 1);then ran
$ bunx oxlint --deny typescript/no-floating-promises test.ts
× eslint(no-unused-vars): Parameter 'reject' is declared but never used. Unused parameters should
start with a '_'.
╭─[test.ts:1:39]
so oxlint is picking up some typescript rules but not no-floating-promises
based on #3105, I'm guessing this requires the type-aware integration? should the docs be updated to indicate that (if that's the case)?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-linterArea - LinterArea - Linter
Type
Fields
Give feedbackPriority
None yet
Effort
None yet
{ "$schema": "./node_modules/oxlint/configuration_schema.json", "plugins": [ "typescript", ], "categories": { "correctness": "error", }, "rules": { "typescript/no-floating-promises": "error", }, }