Skip to content
← Back to rules

vitest/warn-todo Correctness

What it does

This rule warns about usage of .todo in describe, it, or test functions.

Why is this bad?

The tests you push should be complete. Any pending/TODO code should not be committed.

Examples

Examples of incorrect code for this rule:

js
describe.todo("foo", () => {});
it.todo("foo", () => {});
test.todo("foo", () => {});

Examples of correct code for this rule:

js
describe([])("foo", () => {});
it([])("foo", () => {});
test([])("foo", () => {});

How to use

To enable this rule using the config file or in the CLI, you can use:

json
{
  "plugins": ["vitest"],
  "rules": {
    "vitest/warn-todo": "error"
  }
}
ts
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["vitest"],
  rules: {
    "vitest/warn-todo": "error",
  },
});
bash
oxlint --deny vitest/warn-todo --vitest-plugin

Version

This rule was added in v1.37.0.

References