Repository navigation
Labels
A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bug
Description
Environment information
Details
CLI:
Version: 2.5.14
Color support: false
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
BIOME_DISTRIBUTION: npm
BIOME_LOG_FILE: unset
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_LOG_LEVEL: unset
BIOME_LOG_KIND: unset
BIOME_CONFIG_PATH: unset
BIOME_THREADS: unset
BIOME_WATCHER_KIND: unset
BIOME_WATCHER_POLLING_INTERVAL: unset
BIOME_BINARY: unset
RUST_BACKTRACE: unset
NO_COLOR: 1
TERM: xterm-256color
JS_RUNTIME_VERSION: v24.18.0
JS_RUNTIME_NAME: node
NODE_PACKAGE_MANAGER: bun/1.4.0
Biome Configuration:
Status: Loaded successfully.
Path: biome.json
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: false
HTML full support enabled: unset
Linter:
JavaScript enabled: unset
JSON enabled: unset
CSS enabled: unset
GraphQL enabled: unset
Recommended: unset
Enabled rules:
complexity/noUselessReturn
Workspace:
Open Documents: 0Rule name
noUselessReturn
Playground link
Expected result
- A
return;that is the body of an unbracedif/elseis either not reported or removed together with itsif. - Leading comments of the removed statement are kept.
Actual (safe fixes): if (aborted) return; becomes if (aborted) with no consequent, so the file no longer parses (SyntaxError: Unexpected token '}'); if (a) return; else return; breaks the same way. The // best effort comment above the other removed return; is deleted with it.
Reproduces in the playground on Biome main (9bbff0c) and in the 2.5.14 CLI.
Code of Conduct
- I agree to follow Biome's Code of Conduct
Tool Use Disclaimer: Claude Code using Anthropic Opus 5.5 helped build the reproduction.
Metadata
Metadata
Assignees
Labels
A-LinterArea: linterL-JavaScriptLanguage: JavaScript and super languagesS-Bug-confirmedStatus: report has been confirmed as a valid bug
Activity
fix(lint/noUselessReturn): keep comments, skip unbraced if bodies andβ¦
Update dependency @biomejs/biome to v2.5.15 (#51)
Update dependency @biomejs/biome to v2.5.15 (#25)
Update dependency @biomejs/biome to v2.5.15 (#1775)