mirror of
https://github.com/halo-dev/theme-earth.git
synced 2025-10-15 15:20:33 +00:00
chore: integrate husky and lint-staged for pre-commit code formatting (#162)
引入 husky 和 lint-staged,实现在提交代码前格式化修改的代码。 ```release-note None ```
This commit is contained in:
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
@@ -0,0 +1 @@
|
|||||||
|
npx lint-staged
|
10
package.json
10
package.json
@@ -8,7 +8,8 @@
|
|||||||
"build": "tsc && vite build",
|
"build": "tsc && vite build",
|
||||||
"lint": "eslint ./src --ext .js,.cjs,.mjs,.ts,.cts,.mts --ignore-path .gitignore",
|
"lint": "eslint ./src --ext .js,.cjs,.mjs,.ts,.cts,.mts --ignore-path .gitignore",
|
||||||
"prettier": "prettier --write \"./src/**/*.{js,ts,css,json,ml,yaml,html}\" \"./templates/**/*.html\"",
|
"prettier": "prettier --write \"./src/**/*.{js,ts,css,json,ml,yaml,html}\" \"./templates/**/*.html\"",
|
||||||
"release": "release-it"
|
"release": "release-it",
|
||||||
|
"prepare": "husky"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"halo",
|
"halo",
|
||||||
@@ -36,6 +37,11 @@
|
|||||||
"url": "https://github.com/halo-dev/theme-earth",
|
"url": "https://github.com/halo-dev/theme-earth",
|
||||||
"type": "git"
|
"type": "git"
|
||||||
},
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"*.{ts,json,yaml,yml,html}": [
|
||||||
|
"prettier --write"
|
||||||
|
]
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify-json/bx": "^1.1.10",
|
"@iconify-json/bx": "^1.1.10",
|
||||||
"@iconify-json/gg": "^1.1.9",
|
"@iconify-json/gg": "^1.1.9",
|
||||||
@@ -51,6 +57,8 @@
|
|||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^8.10.0",
|
"eslint-config-prettier": "^8.10.0",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^4.2.1",
|
||||||
|
"husky": "^9.1.5",
|
||||||
|
"lint-staged": "^15.2.9",
|
||||||
"postcss": "^8.4.38",
|
"postcss": "^8.4.38",
|
||||||
"prettier": "^3.3.1",
|
"prettier": "^3.3.1",
|
||||||
"prettier-plugin-tailwindcss": "^0.6.2",
|
"prettier-plugin-tailwindcss": "^0.6.2",
|
||||||
|
6629
pnpm-lock.yaml
generated
6629
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user