oxc-project/oxc · error · OxcDiagnostic
The use of `.todo` is not recommended.
Error message
The use of `.todo` is not recommended.
What it means
Fires when the warn-todo rule detects a .todo() modifier on a test declaration during run. It is a style guard discouraging placeholder tests that are skipped silently and can hide unfinished work before merge.
Source
Thrown at crates/oxc_linter/src/rules/vitest/warn_todo.rs:16
use oxc_ast::AstKind;
use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;
use crate::{
context::LintContext,
rule::Rule,
utils::{
JestFnKind, JestGeneralFnKind, PossibleJestNode, is_type_of_jest_fn_call,
parse_general_jest_fn_call,
},
};
fn warn_todo_diagnostic(span: Span) -> OxcDiagnostic {
OxcDiagnostic::warn("The use of `.todo` is not recommended.")
.with_help("Write an actual test and remove the `.todo` modifier before pushing/merging your changes.")
.with_label(span)
}
#[derive(Debug, Default, Clone)]
pub struct WarnTodo;
declare_oxc_lint!(
/// ### 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
///View on GitHub (pinned to e1e7af627c)
Solutions
- Implement the test body and remove the .todo modifier
- Delete the placeholder test if the behavior is no longer planned
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/oxc_linter/src/rules/vitest/warn_todo.rs:16 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20).
Data as JSON: /api/errors/6be6e6546743cfea.
Report an issue: GitHub.