{"record":{"id":"8b07180189dbac98","repo":"oxc-project/oxc","slug":"empty-statement-type-specifier-is-not-allowed","errorCode":null,"errorMessage":"Empty {statement_type} specifier is not allowed","messagePattern":"Empty (.+?) specifier is not allowed","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/unicorn/require_module_specifiers.rs","lineNumber":17,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{ExportNamedDeclaration, ImportDeclaration, ImportDeclarationSpecifier},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_macros::declare_oxc_lint;\nuse oxc_span::Span;\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    fixer::{RuleFix, RuleFixer},\n    rule::Rule,\n};\n\nfn require_module_specifiers_diagnostic(span: Span, statement_type: &str) -> OxcDiagnostic {\n    OxcDiagnostic::warn(format!(\"Empty {statement_type} specifier is not allowed\"))\n        .with_help(\"Remove empty braces\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct RequireModuleSpecifiers;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Enforce a non-empty specifier list in `import` and `export` statements.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// Empty `import`/`export` specifiers add no value and can be confusing.\n    /// If you want to import a module for side effects, use `import 'module'` instead.\n    ///\n    /// ### Examples","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/unicorn/require_module_specifiers.rs#L1-L35","documentation":"Emitted by the unicorn/require-module-specifiers rule when an import or export declaration has a named-specifier list with no entries (`import {} from '...'` or `export {}`). It fires at the declaration span because an empty specifier list has no effect; a bare `import '...'` should be used for side-effect-only imports.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/unicorn/require_module_specifiers.rs:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the declaration entirely if it is dead code","Use a bare side-effect import `import 'module';` if only side effects are wanted"],"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"}