-
Notifications
You must be signed in to change notification settings - Fork 148
Open
Labels
Description
Your Environment
- Prettier version: 3.3.3
- node version: v20.12.0
- package manager: pnpm@10
- IDE: VScode
Describe the bug
Sorting imports is breaking on types in .svelte files
To Reproduce
- Svelte file with
lang="ts"
- Type on exported variable
Expected behavior
Sorting works in Svelte files with lang="ts"
Screenshots, code sample, etc
This one breaks
<script lang="ts">
export let name: string
</script>
And this one works
<script lang="ts">
export let name
</script>
Configuration File (cat .prettierrc, prettier.config.js, .prettier.js)
{
"useTabs": false,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"bracketSameLine": true,
"semi": false,
"printWidth": 80,
"arrowParens": "always",
"plugins": ["prettier-plugin-svelte", "@trivago/prettier-plugin-sort-imports"],
"importOrder": [
"^@smkit/*",
"^~icons",
"^(\\$app)|(\\$env)|(\\$lib)|(\\$ui)",
"^\\$",
"^[./]"
],
"importOrderParserPlugins": ["typescript", "decorators-legacy"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
Error log
Contribute to @trivago/prettier-plugin-sort-imports
- I'm willing to fix this bug 🥇
regexPattern