-
-
Notifications
You must be signed in to change notification settings - Fork 781
Description
Biome Bug Report: Crash in useNamingConvention with biome check --write
Bug Description
Biome v2.2.6 crashes with an internal panic when running biome check --write on files that have useNamingConvention violations. The crash occurs specifically in the semantic model builder.
Error Details
Source Location: /Users/runner/work/biome/biome/crates/biome_js_semantic/src/semantic_model/builder.rs:217:56
Thread Name: biome::workspace_worker_0
Message: no entry found for key
packages/spider/src/adapters/dom.ts internalError/panic INTERNAL
× processing panicked: no entry found for key
Steps to Reproduce
1. Configuration
biome.json:
{
"$schema": "https://biomejs.dev/schemas/2.2.6/schema.json",
"linter": {
"enabled": true,
"rules": {
"style": {
"useNamingConvention": {
"level": "warn",
"options": {
"strictCase": false,
"conventions": [
{
"selector": { "kind": "variable" },
"formats": ["camelCase", "CONSTANT_CASE", "PascalCase"]
}
]
}
}
}
}
}
}2. Sample File with Violations
The crash occurs on files using cheerio with $ variables (which violate useNamingConvention):
import * as cheerio from 'cheerio';
export class DomAdapter {
private extractLinks(html: string) {
const $ = cheerio.load(html); // Violates useNamingConvention
const links = [];
$('a').each((_, element) => {
const $link = $(element); // Violates useNamingConvention
links.push($link.attr('href'));
});
return links;
}
}3. Trigger the Crash
biome check --write path/to/file.tsExpected Behavior
Biome should either:
- Apply the auto-fix for
useNamingConventionviolations, OR - Report that violations cannot be auto-fixed
Actual Behavior
Biome crashes with an internal panic in semantic_model/builder.rs:217:56
What Works
- ✅
biome lint(read-only mode) - ✅
biome check(read-only mode) - ✅
biome check --write --linter-enabled=false(formatter + organizeImports only) - ✅
biome check --write --formatter-enabled=false --assist-enabled=false(linter only, but still crashes with useNamingConvention) - ✅
biome check --writewithuseNamingConvention: "off"
What Crashes
- ❌
biome check --writewithuseNamingConventionenabled - ❌
biome check --write --formatter-enabled=false --assist-enabled=false(linter-only mode with useNamingConvention)
Root Cause Analysis
Through systematic testing, we isolated that:
- The crash is NOT in the formatter
- The crash is NOT in the assist/organizeImports
- The crash IS in the linter's semantic model builder
- The crash is specifically triggered by the
useNamingConventionrule when running with--write
The linter can detect violations in read-only mode without crashing, but crashes when attempting to write fixes.
Environment
- Biome version: 2.2.6
- OS: macOS (Darwin 24.6.0)
- Node version: 24.x
- Package manager: pnpm
Workaround
Disable useNamingConvention for affected files via biome.json overrides:
{
"overrides": [
{
"includes": ["packages/spider/src/**/*.ts"],
"linter": {
"rules": {
"style": {
"useNamingConvention": "off"
}
}
}
}
]
}Additional Context
This appears to be a different bug from previously reported semantic model issues:
- Issue Biome encountered an unexpected error (semantic_model/scope.rs:115:33) #2659 (scope.rs:115:33) - Different location
- Issue 🐛
no entry found for key(crates/biome_js_semantic/src/semantic_model/scope.rs) #2683 (scope.rs) - Different location
This is the first report of a crash at builder.rs:217:56 with the useNamingConvention rule.
Minimal Reproduction Repository
Available on request - the issue reproduces consistently with the configuration and sample code above.