Skip to content

Commit 4d432ab

Browse files
committed
👷 Add prettier
1 parent f6c7307 commit 4d432ab

File tree

4 files changed

+60
-4
lines changed

4 files changed

+60
-4
lines changed

‎.prettierignore‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# build output
2+
dist/
3+
.output/
4+
5+
# dependencies
6+
node_modules/
7+
8+
# logs
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
pnpm-debug.log*
13+
14+
# Ignore files for PNPM, NPM and YARN
15+
pnpm-lock.yaml
16+
package-lock.json
17+
yarn.lock
18+
19+
# environment variables
20+
.env
21+
.env.production
22+
23+
# macOS-specific files
24+
.DS_Store

‎package.json‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"version": "0.0.1",
55
"private": true,
66
"scripts": {
7-
"dev": "astro dev",
8-
"start": "astro dev",
97
"build": "astro build",
8+
"check": "astro check",
9+
"dev": "astro dev",
1010
"preview": "astro preview",
11-
"astro": "astro"
11+
"start": "astro dev",
12+
"prettier:check": "prettier --check --plugin-search-dir=. .",
13+
"prettier:format": "prettier --cache --write --plugin-search-dir=. ."
1214
},
1315
"dependencies": {
1416
"@algolia/client-search": "^4.15.0",
@@ -28,6 +30,8 @@
2830
},
2931
"devDependencies": {
3032
"@astrojs/mdx": "^0.17.2",
31-
"html-escaper": "^3.0.3"
33+
"html-escaper": "^3.0.3",
34+
"prettier": "^2.8.4",
35+
"prettier-plugin-astro": "^0.8.0"
3236
}
3337
}

‎pnpm-lock.yaml‎

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎prettier.config.cjs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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+
singleQuote: true,
12+
semi: false,
13+
trailingComma: 'none'
14+
}

0 commit comments

Comments
 (0)