Skip to content

linter: typescript/no-floating-promises doesn't work with sample code #13669

@raylu

Description

@raylu

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?

{
    "$schema": "./node_modules/oxlint/configuration_schema.json",
    "plugins": [
        "typescript",
    ],
    "categories": {
        "correctness": "error",
    },
    "rules": {
        "typescript/no-floating-promises": "error",
    },
}

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)?

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions