{"record":{"id":"a782598c3cde87c8","repo":"oxc-project/oxc","slug":"name-should-have-an-explicit-delay-argument","errorCode":null,"errorMessage":"`{name}` should have an explicit delay argument.","messagePattern":"`(.+?)` should have an explicit delay argument\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/unicorn/explicit_timer_delay.rs","lineNumber":18,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{Argument, CallExpression, Expression, UnaryOperator},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::{GetSpan, Span};\nuse schemars::JsonSchema;\nuse serde::Deserialize;\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n};\n\nfn missing_delay_diagnostic(span: Span, name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"`{name}` should have an explicit delay argument.\"))\n        .with_help(\"Add an explicit delay argument.\")\n        .with_label(span)\n}\n\nfn redundant_delay_diagnostic(span: Span, name: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"`{name}` should not have an explicit delay of `0`.\"))\n        .with_help(\"Remove the explicit `0` delay argument.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone, Copy, Deserialize, JsonSchema)]\n#[serde(rename_all = \"kebab-case\")]\npub enum ExplicitTimerDelayMode {\n    #[default]\n    /// Require explicit `delay` argument for clarity.\n    Always,\n    /// Disallow explicit `0` delay, prefer implicit default.\n    Never,","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/unicorn/explicit_timer_delay.rs#L1-L36","documentation":"Raised by unicorn/explicit-timer-delay in 'always' mode when setTimeout/setInterval is called without an explicit delay argument, relying on the implicit browser default (0/4ms) and hiding timing intent.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/unicorn/explicit_timer_delay.rs:18 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an explicit delay: setTimeout(fn, 0).","Set the rule option to 'never' if implicit delays are acceptable in the codebase."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}