`noUselessReturn` safe fix removes a final `return;` that TypeScript's `noImplicitReturns` needs (TS7030)
Author: AlbinoGeekCreated Sep 22, 2026Updated Sep 30, 2026
LabelsA-LinterL-JavaScriptS-Bug-confirmed
Environment information
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
In TypeScript files, a trailing return; in a function that returns a value on another path isn't reported, or its fix is marked unsafe. Same reasoning as #11017.
Actual: the safe fix removes the final return;. With "strict": true, "noImplicitReturns": true, tsc passed before the fix and fails after it with TS7030: Not all code paths return a value. Combined with noUselessUndefined (return undefined becomes return;), check --write turns a compiling function into a TS7030 error in two safe steps.
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.
Source: biomejs/biome