Skip to content

linter: eslint/no-lone-blocks errors on if & else blocks containing only a comment #8697

@MichaelGoff

Description

@MichaelGoff

What version of Oxlint are you using?

0.15.8

What command did you run?

npx oxlint

What does your .oxlint.json config file look like?

{
  "rules": {
    "no-lone-blocks": "error"
  }
}

What happened?

Oxlint errors on if, else, or else if blocks containing only a comment. Eslint does not error on these cases.

Example case

if (foo) {
  // do nothing
}
else if (bar) {
  // do nothing again
}
else {
  console.log('not foo');
}

if (baz) {
  console.log(baz);
} 
else {
  // do nothing
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linterArea - LinterC-bugCategory - Buggood first issueExperience Level - Good for newcomers

    Type

    No type

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions