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-256color"
JS_RUNTIME_VERSION: "v22.11.0"
JS_RUNTIME_NAME: "node"
NODE_PACKAGE_MANAGER: "pnpm/9.7.1"
Biome Configuration:
Status: Loaded successfully
Formatter disabled: false
Linter disabled: false
Organize imports disabled: true
VCS disabled: false
Workspace:
Open Documents: 0
This one's easy to reproduce.
With useImportType
* enabled, biome treats certain term-level identifiers (such as object
) as types, even if the identifier is used as a value in that file.
Since the unsafe
flag is opt-in, this has the potential to cause a runtime exception unless it's caught during review / by our CI/CD pipeline.
Config:
I believe useImportType
is turned on by default, so any configuration that doesn't override it is enough to reproduce.
Repro:
/// ex-01.ts
export namespace object {
export const keys = globalThis.Object.keys
}
This is what I wrote:
/// ex-02.ts
import { object } from "./ex_01.js"
console.log(object.keys(globalThis))
This is what biome changes it to:
/// ex-02.ts
// vvvv
import { type object } from "./ex_01.js"
// vv this now throws
console.log(object.keys(globalThis))
It shouldn't add inline type keywords if the identifier is used as a term in that same file.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too