{"record":{"id":"2a4b06a16bc02dd4","repo":"oxc-project/oxc","slug":"timeout-must-be-a-number","errorCode":null,"errorMessage":"Timeout must be a number.","messagePattern":"Timeout must be a number\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/vitest/require_test_timeout.rs","lineNumber":40,"sourceCode":"            \"Add a numeric third argument, a `{ timeout }` option object second argument, or call `vi.setConfig({ testTimeout: ... })` before this test.\",\n        )\n        .with_label(span)\n}\n\nfn config_missing_timeout_object(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"`vi.setConfig()` is missing a `testTimeout` property.\")\n        .with_help(\"Pass an object with a `testTimeout` property to `vi.setConfig()`.\")\n        .with_label(span)\n}\n\nfn test_options_missing_timeout_property(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Test options object is missing a `timeout` property.\")\n        .with_help(\"Add a `timeout` property to the options object.\")\n        .with_label(span)\n}\n\nfn timeout_must_be_a_number(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Timeout must be a number.\")\n        .with_help(\"Use a non-negative numeric literal for the timeout value.\")\n        .with_label(span)\n}\n\nfn timeout_must_be_non_negative(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Timeout must not be negative.\")\n        .with_help(\"Use a non-negative numeric literal for the timeout value.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct RequireTestTimeout;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Requires every test to have a timeout specified, either as a numeric third\n    /// argument, a `{ timeout }` option, or via `vi.setConfig({ testTimeout: ... })`.","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/vitest/require_test_timeout.rs#L22-L58","documentation":"Emitted by the vitest/require-test-timeout rule when the timeout value supplied to a test is not a number (e.g. a string or other expression). Vitest requires the timeout to be a numeric millisecond value, so a non-numeric timeout is invalid and flagged during timeout-value parsing.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/vitest/require_test_timeout.rs:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a numeric literal for the timeout, e.g. `5000` instead of `'5000'`","Cast or convert the value to a number before passing it"],"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"}