biome: π Format fails on parsing a catch clause with an union type even with formatWithErrors is set to true
Environment information
CLI:
Version: 1.9.4
Color support: true
Platform:
CPU Architecture: aarch64
OS: macos
Environment:
BIOME_LOG_PATH: unset
BIOME_LOG_PREFIX_NAME: unset
BIOME_CONFIG_PATH: unset
NO_COLOR: unset
TERM: "xterm-ghostty"
JS_RUNTIME_VERSION: "v22.12.0"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "yarn/4.1.0"
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: true
Organize imports disabled: true
VCS disabled: true
Formatter:
Format with errors: true
Indent style: Tab
Indent width: 2
Line ending: Lf
Line width: 120
Attribute position: Auto
Bracket spacing: BracketSpacing(false)
Ignore: []
Include: []
JavaScript Formatter:
Enabled: true
JSX quote style: Single
Quote properties: AsNeeded
Trailing commas: Es5
Semicolons: AsNeeded
Arrow parentheses: AsNeeded
Bracket spacing: unset
Bracket same line: false
Quote style: Single
Indent style: unset
Indent width: unset
Line ending: unset
Line width: unset
Attribute position: unset
JSON Formatter:
Enabled: true
Indent style: unset
Indent width: unset
Line ending: unset
Line width: unset
Trailing Commas: unset
CSS Formatter:
Enabled: true
Indent style: unset
Indent width: unset
Line ending: unset
Line width: unset
Quote style: Double
GraphQL Formatter:
Enabled: true
Indent style: unset
Indent width: unset
Line ending: unset
Line width: unset
Bracket spacing: unset
Quote style: unset
Workspace:
Open Documents: 0
Configuration
It doesnβt matter, I can reproduce it with the default config on the playground.
try {
thing()
} catch(e: Error | MyError) { //<-- fails on this line
}
Playground link
Code of Conduct
- I agree to follow Biomeβs Code of Conduct
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 19 (11 by maintainers)
This was recently fixed by @unvalley in https://github.com/biomejs/biome/pull/5719
I was asking because we didnβt know what command you were executing, and thatβs important to us. Thank you for sharing.
@ematipico canβt get any more minimal than this I guess π https://github.com/biomejs/biome/issues/5426#issuecomment-2747623775 I just tried this with
--skip-errorsand still will exit with non-zero code.foo.tsThen I ran
yarn biome format --skip-errors --write ./foo.ts, the file is NOT formatted and I get this message plus it exists with non-zero code.With this minimal
biome.jsonThank you, that provides more information. The bug isnβt formatting but parsing. π