Add astro formatter mapping to oxlint editor config

oxfmt doesn't format .astro files, so ultracite init now points VS Code
at the astro-build.astro-vscode extension for astro files under oxlint.
This commit is contained in:
Hayden Bleasel
2026-07-07 18:52:30 -07:00
parent 057753e35c
commit 83b2783c94
3 changed files with 10 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"ultracite": patch
---
Add an `[astro]` formatter mapping (`astro-build.astro-vscode`) to the oxlint VS Code editor settings generated by `ultracite init`, since oxfmt doesn't format `.astro` files.
+3
View File
@@ -24,5 +24,8 @@
"[yaml]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
"editor.codeActionsOnSave": {
"source.fixAll.oxc": "explicit"
},
"[astro]": {
"editor.defaultFormatter": "astro-build.astro-vscode"
}
}
+2
View File
@@ -30,6 +30,7 @@ const vscodeBaseConfig = {
};
// Extension IDs and shared VS Code paths, extracted to avoid repeated literals.
const ASTRO_FORMATTER = "astro-build.astro-vscode";
const BIOME_FORMATTER = "biomejs.biome";
const OXC_FORMATTER = "oxc.oxc-vscode";
const VSCODE_INSTALL_COMMAND = "code --install-extension";
@@ -63,6 +64,7 @@ export const vscodeBiomeConfig = {
// Maps https://oxc.rs/docs/guide/usage/formatter.html#supported-languages
// to https://code.visualstudio.com/docs/languages/identifiers
export const vscodeOxlintConfig = {
"[astro]": { "editor.defaultFormatter": ASTRO_FORMATTER },
"[css]": { "editor.defaultFormatter": OXC_FORMATTER },
"[graphql]": { "editor.defaultFormatter": OXC_FORMATTER },
"[handlebars]": { "editor.defaultFormatter": OXC_FORMATTER },