{"record":{"id":"23d3b5f134e7d4f1","repo":"oxc-project/oxc","slug":"file-path-must-be-present-for-rule-diagnostics","errorCode":null,"errorMessage":"File path must be present for rule diagnostics","messagePattern":"File path must be present for rule diagnostics","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/tsgolint.rs","lineNumber":1291,"sourceCode":"                DiagnosticKind::Rule => TsGoLintDiagnostic::Rule(TsGoLintRuleDiagnostic {\n                    rule: diagnostic_payload\n                        .rule\n                        .expect(\"Rule name must be present for rule diagnostics\"),\n                    span: diagnostic_payload.range.map_or_else(\n                        || {\n                            debug_assert!(false, \"Range must be present for rule diagnostics\");\n                            Span::default()\n                        },\n                        |range| Span::new(range.pos, range.end),\n                    ),\n                    message: diagnostic_payload.message,\n                    fixes: diagnostic_payload.fixes,\n                    suggestions: diagnostic_payload.suggestions,\n                    labeled_ranges: diagnostic_payload.labeled_ranges,\n                    file_path: PathBuf::from(\n                        diagnostic_payload\n                            .file_path\n                            .expect(\"File path must be present for rule diagnostics\"),\n                    ),\n                }),\n                DiagnosticKind::Internal => {\n                    TsGoLintDiagnostic::Internal(TsGoLintInternalDiagnostic {\n                        message: diagnostic_payload.message,\n                        span: diagnostic_payload.range.map(|range| Span::new(range.pos, range.end)),\n                        file_path: diagnostic_payload.file_path.map(PathBuf::from),\n                    })\n                }\n            }))\n        }\n        MessageType::Timing => {\n            let timing_payload = serde_json::from_str::<TsGoLintTimingPayload>(&payload_str)\n                .map_err(TsGoLintMessageParseError::InvalidTimingPayload)?;\n\n            Ok(TsGoLintMessage::Timing(timing_payload))\n        }\n    }","sourceCodeStart":1273,"sourceCodeEnd":1309,"githubUrl":"https://github.com/oxc-project/oxc/blob/a3d33dda7cb69da23db4fcaa2c0c05de61e760a1/crates/oxc_linter/src/tsgolint.rs#L1273-L1309","documentation":"Runtime guard in tsgolint.rs when decoding a rule diagnostic payload whose file path field is missing. The diagnostic cannot be attributed to a source file without it, so the conversion fails; it signals malformed or version-mismatched JSON from the tsgolint process.","triggerScenarios":"Thrown at crates/oxc_linter/src/tsgolint.rs:1291 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure tsgolint includes the file path in every diagnostic message","Verify the tsgolint binary version matches the protocol expected by this oxc version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a3d33dda7cb69da23db4fcaa2c0c05de61e760a1","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}