Skip to content

Commit 2574c92

Browse files
committed
chore: optimize lint-staged execution and refactor configuration
1 parent 41d228c commit 2574c92

3 files changed

Lines changed: 7 additions & 11 deletions

File tree

astro/.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
cd astro
2-
npx lint-staged
2+
node --run lint-staged

astro/.lintstagedrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*.{js,jsx,ts,tsx,astro}": ["eslint --fix", "prettier --write"],
3+
"*.{json,md,css}": ["prettier --write"]
4+
}

astro/package.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"format:check": "prettier --check .",
1414
"check": "npm run format:check && npm run lint",
1515
"fix": "npm run format && npm run lint:fix",
16-
"prepare": "cd .. && husky astro/.husky"
16+
"prepare": "cd .. && husky astro/.husky",
17+
"lint-staged": "lint-staged"
1718
},
1819
"dependencies": {
1920
"@astrojs/mdx": "^4.3.13",
@@ -48,14 +49,5 @@
4849
"prettier-plugin-astro": "^0.14.1",
4950
"typescript": "^5.9.3",
5051
"typescript-eslint": "^8.53.1"
51-
},
52-
"lint-staged": {
53-
"*.{js,jsx,ts,tsx,astro}": [
54-
"eslint --fix",
55-
"prettier --write"
56-
],
57-
"*.{json,md,css}": [
58-
"prettier --write"
59-
]
6052
}
6153
}

0 commit comments

Comments
 (0)