oxc-project/oxc · error · OxcDiagnostic

Expects the void tags to be empty of any content.

Error message

Expects the void tags to be empty of any content.

What it means

Fires from jsdoc/empty-tags when a tag that must be empty (such as @abstract, @async, @deprecated-style void tags per the rule's list) is given body content. The helper names the offending tag in the help text and labels its span.

Source

Thrown at crates/oxc_linter/src/rules/jsdoc/empty_tags.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 empty_tags_diagnostic(span: Span, tag_name: &str) -> OxcDiagnostic {
    OxcDiagnostic::warn("Expects the void tags to be empty of any content.")
        .with_help(format!("`@{tag_name}` tag should not have body."))
        .with_label(span)
}

#[derive(Debug, Default, Clone, Deserialize)]
pub struct EmptyTags(Box<EmptyTagsConfig>);

declare_oxc_lint!(
    /// ### What it does
    ///
    /// Expects the following tags to be empty of any content:
    /// - `@abstract`
    /// - `@async`
    /// - `@generator`
    /// - `@global`
    /// - `@hideconstructor`
    /// - `@ignore`
    /// - `@inner`

View on GitHub (pinned to e1e7af627c)

Solutions

  1. Remove the body content from the void tag
  2. Move the explanatory text into the tag's description position if the tag supports it
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/oxc_linter/src/rules/jsdoc/empty_tags.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/984e7a5cbe0ace17. Report an issue: GitHub.