{"record":{"id":"ff649613573b1de9","repo":"oxc-project/oxc","slug":"unexpected-empty-block-statement-surrounding-arrow","errorCode":null,"errorMessage":"Unexpected empty block statement surrounding arrow body.","messagePattern":"Unexpected empty block statement surrounding arrow body\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/eslint/arrow_body_style.rs","lineNumber":34,"sourceCode":"    context::LintContext,\n    fixer::{RuleFix, RuleFixer},\n    rule::{Rule, TupleRuleConfig},\n};\n\nfn expected_block_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Expected block statement surrounding arrow body.\")\n        .with_help(\"Surround the arrow body with braces and use a return statement.\")\n        .with_label(span)\n}\n\nfn unexpected_block_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected block statement surrounding arrow body.\")\n        .with_help(\"Move the returned value to be immediately after the `=>`.\")\n        .with_label(span)\n}\n\nfn unexpected_empty_block_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected empty block statement surrounding arrow body.\")\n        .with_help(\"Put a value of `undefined` immediately after the `=>`.\")\n        .with_label(span)\n}\n\n/// Diagnostic that is emitted when we don't have a specific help message to provide\nfn unexpected_block_with_unknown_help_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected block statement surrounding arrow body.\").with_label(span)\n}\n\n#[derive(Debug, Default, PartialEq, Clone, Deserialize, Serialize, JsonSchema)]\n#[serde(rename_all = \"kebab-case\")]\nenum Mode {\n    /// Enforces no braces where they can be omitted (default).\n    #[default]\n    AsNeeded,\n    /// Enforces braces around the function body.\n    Always,\n    /// Enforces no braces around the function body (constrains arrow functions to the role of returning an expression).","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/eslint/arrow_body_style.rs#L16-L52","documentation":"Lint diagnostic from eslint/arrow-body-style: an arrow function body is an empty block statement. An empty block implicitly returns undefined, which reads as a mistake rather than an intentional no-op and is flagged separately from a non-empty block.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/eslint/arrow_body_style.rs:34 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return the intended value: () => { return value; }","Write the body as () => undefined if undefined is truly the intent","Add the missing implementation"],"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"}