Repository navigation
🐛 Svelte: Components could be promoted as import types #11389
Copy link
Copy link
Labels
A-LinterArea: linterArea: linterS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug
Description
Environment information
Details
CLI:
Version: 2.5.8
Color support: true
Platform:
CPU Architecture: x86_64
OS: linux
Environment:
BIOME_DISTRIBUTION: npm
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
NO_COLOR: unset
TERM: xterm-ghostty
JS_RUNTIME_VERSION: v26.7.0
JS_RUNTIME_NAME: node
NODE_PACKAGE_MANAGER: pnpm/11.3.0
Biome Configuration:
Status: Loaded successfully.
Path: biome.json
Formatter enabled: true
Linter enabled: true
Assist enabled: true
VCS enabled: true
HTML full support enabled: true
Workspace:
Open Documents: 0What happened?
In Svelte, components are promoted as import types when there is a variable of that component type, even if it's used.
The linter raises a warn/err- The analyzer auto fix adds
type, and breaks the build
Before:
<script lang="ts">
import Modal from "$lib/components/Modal.svelte"
let myModal: Modal
</script>
<Modal bind:this={myModal}>
</Modal>After auto fix:
<script lang="ts">
import type Modal from "$lib/components/Modal.svelte"
let myModal: Modal
</script>
<Modal bind:this={myModal}>
</Modal>Workaround:
"linter": {
"enabled": true,
"rules": {
"preset": "recommended",
"style": {
"useImportType": "off"
}
}
},Expected result
Do not consider as import types when a component is used.
Code of Conduct
- I agree to follow Biome's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-LinterArea: linterArea: linterS-Bug-confirmedStatus: report has been confirmed as a valid bugStatus: report has been confirmed as a valid bug
Activity
github-actions commentedon Aug 18, 2026
✅ Organic activity
No automation signals detected in the analyzed events.
View full analysis →
This is an automated analysis by AgentScan
dyc3 commentedon Aug 18, 2026
Your playground doesn't reproduce the bug. I'm also confused because your
biome rageoutput shows you have html full support enabled, so you shouldn't be seeing this bug in the first place.biome-cookie commentedon Aug 18, 2026
Hello @akhansari, please provide a minimal reproduction. You can use one of the following options:
npm create @biomejs/biome-reproductionIssues marked with
S-Needs reprowill be closed if they have no activity within 3 days.akhansari commentedon Aug 18, 2026
This is weird 🤔 I was able to reproduce it using the playground a few hours ago.
I'll try to provide a repo sample.
akhansari commentedon Aug 18, 2026
@dyc3 You can reproduce the playground content by using
--stdin-file-path.The output should be similar to (
typeadded):Is this related to the extension check?
dyc3 commentedon Aug 18, 2026
I was able to reproduce it, and it appears this really does only affect
--stdin-file-pathUpdate dependency @biomejs/biome to v2.5.11 (#20)
Update dependency @biomejs/biome to v2.5.11 (#42)