{"record":{"id":"a7d9a8a0545193f9","repo":"oxc-project/oxc","slug":"rule-documentation-must-be-specified-either-via-do","errorCode":null,"errorMessage":"rule documentation must be specified either via doc comments or the `docs` attribute","messagePattern":"rule documentation must be specified either via doc comments or the `docs` attribute","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/oxc_macros/src/declare_oxc_lint.rs","lineNumber":218,"sourceCode":"        let Some(version) = version else {\n            return Err(Error::new(\n                struct_name.span(),\n                \"missing `version = \\\"x.y.z\\\"` or `version = \\\"next\\\"` in `declare_oxc_lint!`\",\n            ));\n        };\n\n        // Validate that any markdown fenced code blocks (```) in rule docs are properly closed.\n        // If the total number of fences found is odd, a block was not closed.\n        #[cfg(feature = \"ruledocs\")]\n        if !backtick_fences_count.is_multiple_of(2) {\n            return Err(Error::new(\n                struct_name.span(),\n                \"unclosed markdown code block in documentation, please close all ``` fences\",\n            ));\n        }\n        #[cfg(feature = \"ruledocs\")]\n        let Some(documentation) = documentation else {\n            return Err(Error::new(\n                struct_name.span(),\n                \"rule documentation must be specified either via doc comments or the `docs` attribute\",\n            ));\n        };\n\n        Ok(Self {\n            name: struct_name,\n            is_tsgolint_rule,\n            plugin,\n            category,\n            fix,\n            #[cfg(feature = \"ruledocs\")]\n            documentation,\n            used_in_test: false,\n            config,\n            version,\n            #[cfg(feature = \"ruledocs\")]\n            short_description,","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/oxc-project/oxc/blob/a3d33dda7cb69da23db4fcaa2c0c05de61e760a1/crates/oxc_macros/src/declare_oxc_lint.rs#L200-L236","documentation":"Compile-time error raised inside the declare_oxc_lint! proc-macro when no rule documentation was provided — neither doc comments (///) on the declaration nor a docs attribute. Every published rule must carry rendered documentation, so the macro rejects the expansion.","triggerScenarios":"Thrown at crates/oxc_macros/src/declare_oxc_lint.rs:198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add /// doc comments describing what the rule does and why","Or supply the documentation via the docs attribute in the declare_oxc_lint! block"],"exampleFix":null,"handlingStrategy":"validation","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"}