Skip to content

Commit a6ada99

Browse files
committed
chore: set up format on pre-commit
1 parent c28fa79 commit a6ada99

File tree

4 files changed

+286
-1
lines changed

4 files changed

+286
-1
lines changed

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec lint-staged

.lintstagedrc.mjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default {
2+
"**/*.{astro,js,mjs,json,ts,yml,yaml}": "pnpm run format",
3+
};

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313
"build": "astro check && astro build",
1414
"preview": "astro preview",
1515
"astro": "astro",
16-
"format": "prettier --write '**/*.{astro,js,mjs,json,json5,ts,yaml,yml}'"
16+
"format": "prettier --write '**/*.{astro,js,mjs,json,json5,ts,yaml,yml}'",
17+
"prepare": "husky"
1718
},
1819
"dependencies": {
1920
"@astrojs/check": "^0.9.4",
2021
"astro": "^4.16.14",
2122
"typescript": "^5.7.2"
2223
},
2324
"devDependencies": {
25+
"husky": "^9.1.7",
26+
"lint-staged": "^15.2.11",
2427
"prettier": "^3.4.2",
2528
"prettier-plugin-astro": "^0.14.1"
2629
}

0 commit comments

Comments
 (0)