Skip to content

Commit

Permalink
chore: integrate husky and lint-staged for pre-commit code formatting (
Browse files Browse the repository at this point in the history
…#162)

引入 husky 和 lint-staged,实现在提交代码前格式化修改的代码。

```release-note
None
```
  • Loading branch information
ruibaby authored Aug 22, 2024
1 parent 175c40e commit c98869c
Show file tree
Hide file tree
Showing 3 changed files with 4,084 additions and 2,618 deletions.
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"build": "tsc && vite build",
"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\"",
"release": "release-it"
"release": "release-it",
"prepare": "husky"
},
"keywords": [
"halo",
Expand Down Expand Up @@ -36,6 +37,11 @@
"url": "https://github.com/halo-dev/theme-earth",
"type": "git"
},
"lint-staged": {
"*.{ts,json,yaml,yml,html}": [
"prettier --write"
]
},
"devDependencies": {
"@iconify-json/bx": "^1.1.10",
"@iconify-json/gg": "^1.1.9",
Expand All @@ -51,6 +57,8 @@
"eslint": "^8.57.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^9.1.5",
"lint-staged": "^15.2.9",
"postcss": "^8.4.38",
"prettier": "^3.3.1",
"prettier-plugin-tailwindcss": "^0.6.2",
Expand Down
Loading

0 comments on commit c98869c

Please sign in to comment.