mirror of
https://github.com/haydenbleasel/ultracite.git
synced 2026-09-18 19:55:04 +08:00
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:
@@ -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.
|
||||
Vendored
+3
@@ -24,5 +24,8 @@
|
||||
"[yaml]": { "editor.defaultFormatter": "oxc.oxc-vscode" },
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.oxc": "explicit"
|
||||
},
|
||||
"[astro]": {
|
||||
"editor.defaultFormatter": "astro-build.astro-vscode"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user