{"record":{"id":"aaec897548d1641e","repo":"oxc-project/oxc","slug":"unexpected-braces-in-empty-case-clause","errorCode":null,"errorMessage":"Unexpected braces in empty case clause.","messagePattern":"Unexpected braces in empty case clause\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/unicorn/switch_case_braces.rs","lineNumber":16,"sourceCode":"use oxc_ast::{AstKind, ast::Statement};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::{GetSpan, Span};\nuse schemars::JsonSchema;\nuse serde::{Deserialize, Serialize};\n\nuse crate::{\n    AstNode,\n    ast_util::get_preceding_indent_str,\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n};\n\nfn switch_case_braces_diagnostic_empty_clause(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unexpected braces in empty case clause.\")\n        .with_help(\"Remove braces in empty case clause.\")\n        .with_label(span)\n}\n\nfn switch_case_braces_diagnostic_missing_braces(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Missing braces in case clause.\")\n        .with_help(\"Add Braces for case clause.\")\n        .with_label(span)\n}\n\nfn switch_case_braces_diagnostic_unnecessary_braces(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Unnecessary braces in case clause.\")\n        .with_help(\"Remove Braces for case clause.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Clone, Deserialize)]\npub struct SwitchCaseBraces(Box<SwitchCaseBracesConfig>);","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/unicorn/switch_case_braces.rs#L1-L34","documentation":"Emitted by the unicorn/switch-case-braces rule at an empty `case` (or `default`) clause wrapped in braces, e.g. `case 'a': {} break;`. Braces around an empty clause are pointless noise, so the rule asks for their removal.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/unicorn/switch_case_braces.rs:16 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Delete the braces from the empty case clause"],"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-14T00:17:10.932Z"}