oxc-project/oxc · error · OxcDiagnostic

No empty blocks

Error message

No empty blocks

What it means

Fires from jsdoc/no-blank-blocks when a JSDoc comment block contains no content (empty /** */ block). The diagnostic helper adds only a label — no help text — and the rule offers an optional enableFixer to strip such blocks automatically.

Source

Thrown at crates/oxc_linter/src/rules/jsdoc/no_blank_blocks.rs:13

use oxc_diagnostics::OxcDiagnostic;
use oxc_macros::declare_oxc_lint;
use oxc_span::Span;
use schemars::JsonSchema;
use serde::Deserialize;

use crate::{
    context::LintContext,
    rule::{DefaultRuleConfig, Rule},
};

fn no_blank_blocks_diagnostic(span: Span) -> OxcDiagnostic {
    OxcDiagnostic::warn("No empty blocks").with_label(span)
}

#[derive(Debug, Default, Clone, Deserialize, JsonSchema)]
#[serde(rename_all = "camelCase", default, deny_unknown_fields)]
pub struct NoBlankBlocks {
    /// Whether to automatically remove blank JSDoc blocks.
    enable_fixer: bool,
}

declare_oxc_lint!(
    /// ### What it does
    ///
    /// Reports and optionally removes blocks with whitespace only.
    ///
    /// ### Why is this bad?
    ///
    /// Blank JSDoc blocks add noise without providing any documentation.
    ///

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Delete the empty JSDoc block
  2. Fill it with a meaningful description
  3. Enable the rule's fixer to auto-remove blank blocks
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/jsdoc/no_blank_blocks.rs:13 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of oxc-project/oxc@e1e7af627c (2026-08-20). Data as JSON: /api/errors/f6eb05edd035088d. Report an issue: GitHub.