Skip to content

Commit 46bd1fc

Browse files
authored
added prettier to vscode (santoshyadavdev#29)
1 parent cfba963 commit 46bd1fc

File tree

6 files changed

+3112
-1187
lines changed

6 files changed

+3112
-1187
lines changed

.prettierrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
plugins: [require.resolve('prettier-plugin-astro')],
3+
overrides: [
4+
{
5+
files: '*.astro',
6+
options: {
7+
parser: 'astro',
8+
},
9+
},
10+
],
11+
};

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"recommendations": ["astro-build.astro-vscode"],
2+
"recommendations": ["astro-build.astro-vscode", "esbenp.prettier-vscode"],
33
"unwantedRecommendations": []
44
}

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@
33
"deno.enablePaths": ["netlify/edge-functions"],
44
"deno.unstable": true,
55
"deno.importMap": ".netlify/edge-functions-import-map.json",
6-
"deno.path": "/home/codespace/.config/netlify/deno-cli/deno"
6+
"deno.path": "/home/codespace/.config/netlify/deno-cli/deno",
7+
"prettier.documentSelectors": ["**/*.astro"],
8+
"[astro]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
}
711
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"dev": "astro dev",
77
"build": "astro build",
8-
"preview": "astro build && astro preview"
8+
"preview": "astro build && astro preview",
9+
"prettier": "prettier --write --plugin-search-dir=. ."
910
},
1011
"devDependencies": {
1112
"@astrojs/image": "^0.11.6",
@@ -20,6 +21,8 @@
2021
"astro-compress": "1.0.8",
2122
"astro-icon": "^0.8.0",
2223
"astro-layouts": "^0.0.6",
24+
"prettier": "^2.8.4",
25+
"prettier-plugin-astro": "^0.8.0",
2326
"remark-code-title": "^0.2.2",
2427
"sharp": "^0.31.2",
2528
"tailwind-scrollbar": "^2.0.1",

0 commit comments

Comments
 (0)