{"record":{"id":"78631c569c799c42","repo":"oxc-project/oxc","slug":"unexpected-eslint-disable-comment-that-does-not","errorCode":null,"errorMessage":"Unexpected `eslint-disable` comment that does not specify any rules to disable.","messagePattern":"Unexpected `eslint-disable` comment that does not specify any rules to disable\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/unicorn/no_abusive_eslint_disable.rs","lineNumber":23,"sourceCode":"use crate::{\n    context::LintContext,\n    disable_directives::{DirectivePrefix, RuleCommentType},\n    rule::Rule,\n};\n\nfn no_abusive_eslint_disable_diagnostic(\n    span: Span,\n    directive_prefix: DirectivePrefix,\n) -> OxcDiagnostic {\n    let message = match directive_prefix {\n        DirectivePrefix::Eslint => {\n            \"Unexpected `eslint-disable` comment that does not specify any rules to disable.\"\n        }\n        DirectivePrefix::Oxlint => {\n            \"Unexpected `oxlint-disable` comment that does not specify any rules to disable.\"\n        }\n    };\n    OxcDiagnostic::warn(message)\n        .with_help(\"Specify the rules you want to disable.\")\n        .with_label(span)\n}\n\n#[derive(Debug, Default, Clone)]\npub struct NoAbusiveEslintDisable;\n\ndeclare_oxc_lint!(\n    /// ### What it does\n    ///\n    /// Disallows `oxlint-disable` or `eslint-disable` comments without specifying rules.\n    ///\n    /// ### Why is this bad?\n    ///\n    /// A general `oxlint-disable` or `eslint-disable` comment suppresses all lint errors, not just the intended one,\n    /// potentially hiding useful warnings and making debugging harder.\n    ///\n    /// ### Examples","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/unicorn/no_abusive_eslint_disable.rs#L5-L41","documentation":"Raised by unicorn/no-abusive-eslint-disable when an `eslint-disable` comment carries no rule names, so it blanket-suppresses every rule on the next line. The helper selects this message for the ESLint directive prefix; the faulting input is the bare disable comment at the labeled span.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/unicorn/no_abusive_eslint_disable.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Append the specific rule names to the comment, e.g. `// eslint-disable-next-line rule-name`","Delete the comment if no rule actually needs suppressing","Fix the underlying lint error instead of disabling it"],"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"}