{"record":{"id":"5db51f6103a3619a","repo":"oxc-project/oxc","slug":"expected-count-empty-line-line-suffix-after-ke","errorCode":null,"errorMessage":"Expected {count} empty line{line_suffix} after {keyword} statement not followed by another {keyword}.","messagePattern":"Expected (.+?) empty line(.+?) after (.+?) statement not followed by another (.+?)\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/import/newline_after_import.rs","lineNumber":29,"sourceCode":"use oxc_semantic::ScopeFlags;\nuse oxc_span::{GetSpan, Span};\nuse schemars::JsonSchema;\nuse serde::{Deserialize, Serialize};\n\nuse crate::{\n    AstNode,\n    ast_util::is_global_require_call,\n    context::LintContext,\n    rule::{DefaultRuleConfig, Rule},\n};\n\nfn newline_after_import_diagnostic(span: Span, count: usize, keyword: &str) -> OxcDiagnostic {\n    let line_suffix = if count == 1 { \"\" } else { \"s\" };\n\n    OxcDiagnostic::warn(format!(\n        \"Expected {count} empty line{line_suffix} after {keyword} statement not followed by another {keyword}.\"\n    ))\n        .with_label(span)\n}\n\n// <https://github.com/import-js/eslint-plugin-import/blob/v2.32.0/docs/rules/newline-after-import.md>\n#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]\n#[serde(rename_all = \"camelCase\", default, deny_unknown_fields)]\npub struct NewlineAfterImport {\n    // Number of empty lines required after import statements.\n    count: u32,\n    // Whether the number of empty lines must be exactly `count`.\n    exact_count: bool,\n    // Whether comments should be considered when counting empty lines.\n    consider_comments: bool,\n}\n\nimpl Default for NewlineAfterImport {\n    fn default() -> Self {\n        Self { count: 1, exact_count: false, consider_comments: false }\n    }","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/import/newline_after_import.rs#L11-L47","documentation":"Fires from import/newline-after-import when an import statement or require() call is not followed by the configured number of empty lines before subsequent code. The helper pluralizes 'line' from the count and interpolates whether the statement was an import or require; the labeled span covers the offending statement.","triggerScenarios":"Thrown at crates/oxc_linter/src/rules/import/newline_after_import.rs:29 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the expected blank line(s) after the import or require statement","Adjust the `count` option if a different spacing is preferred"],"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"}