Skip to content

Commit

Permalink
chore: 添加 lint-staged
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanzhaoyu committed Feb 13, 2023
1 parent f910b5f commit 11544ff
Show file tree
Hide file tree
Showing 7 changed files with 1,122 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec commitlint --config .commitlintrc.json --edit "${1}"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
strict-peer-dependencies=false
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"axios",
"bumpp",
"chatgpt",
"commitlint",
"esno",
"GPTAPI",
"iconify",
Expand Down
18 changes: 15 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,41 @@
"dev": "vite",
"build": "run-p type-check build-only",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit",
"lint": "eslint . --fix --ignore-path .gitignore",
"release": "bumpp package.json --commit --push --tag"
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"release": "bumpp package.json --commit --push --tag",
"prepare": "husky install"
},
"dependencies": {
"naive-ui": "^2.34.3",
"vue": "^3.2.47"
},
"devDependencies": {
"@antfu/eslint-config": "^0.35.2",
"@commitlint/cli": "^17.4.2",
"@commitlint/config-conventional": "^17.4.2",
"@iconify/vue": "^4.1.0",
"@types/node": "^18.13.0",
"@vitejs/plugin-vue": "^4.0.0",
"autoprefixer": "^10.4.13",
"axios": "^1.3.2",
"bumpp": "^8.2.1",
"eslint": "^8.34.0",
"husky": "^8.0.3",
"lint-staged": "^13.1.1",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.21",
"rimraf": "^4.1.2",
"tailwindcss": "^3.2.6",
"typescript": "~4.9.5",
"vite": "^4.1.1",
"vue-tsc": "^1.0.24"
},
"lint-staged": {
"*.{js,ts,jsx,tsx,vue}": [
"pnpm run lint:fix",
"pnpm run type-check"
]
}
}
Loading

0 comments on commit 11544ff

Please sign in to comment.