From a3b9b91caf31d943b1ee6b9f462eb3b0ee7106d9 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 23 Aug 2024 01:29:50 -0700 Subject: [PATCH] Make Biome formatting work out-of-the-box in VS Code (#11759) --- .gitignore | 8 +++++--- .vscode/extensions.json | 3 ++- .vscode/settings.json | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.gitignore b/.gitignore index 2783aac56b..8e6d783543 100644 --- a/.gitignore +++ b/.gitignore @@ -16,9 +16,6 @@ package-lock.json .eslintcache .pnpm-store -# ignore top-level vscode settings -/.vscode/settings.json - # do not commit .env files or any files that end with `.env` *.env @@ -37,3 +34,8 @@ packages/**/e2e/**/fixtures/**/.astro/ packages/**/e2e/**/fixtures/**/env.d.ts examples/**/.astro/ examples/**/env.d.ts + +# make it easy for people to add project-specific Astro settings that they don't +# want to share with others (see +# https://github.com/withastro/astro/pull/11759#discussion_r1721444711) +*.code-workspace diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d8411afe02..ea69b5c704 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,8 @@ "astro-build.astro-vscode", "esbenp.prettier-vscode", "editorconfig.editorconfig", - "dbaeumer.vscode-eslint" + "dbaeumer.vscode-eslint", + "biomejs.biome" ], "unwantedRecommendations": [] } diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..f7dbf2d9a7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,17 @@ +{ + "[json]": { + "editor.defaultFormatter": "biomejs.biome", + }, + "[javascript]": { + "editor.defaultFormatter": "biomejs.biome", + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome", + }, + "[javascriptreact]": { + "editor.defaultFormatter": "biomejs.biome", + }, + "[typescriptreact]": { + "editor.defaultFormatter": "biomejs.biome", + } +}