ci(eslint): add husky and commitlint to eslint code (#1021)

This commit is contained in:
ajaxzheng 2023-12-04 20:14:26 +08:00 committed by GitHub
parent fa0c40a240
commit 532c01132c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 17 deletions

4
.lintstagedrc.json Normal file
View File

@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx,vue}": ["prettier --write", "eslint --fix"],
"*.md": ["prettier --write"]
}

View File

@ -33,6 +33,7 @@
"scripts": {
"preinstall": "npx only-allow pnpm",
"postinstall": "pnpm build:internals",
"prepare": "husky install",
"bootstrap": "pnpm --filter=\"!./packages/dist/**\" install",
"dev": "pnpm build:entry && gulp themeConcat -w & pnpm -C examples/vue3 dev",
"dev:saas": "pnpm create:icon-saas && pnpm build:entry && pnpm -C examples/vue3 dev:saas",
@ -119,7 +120,8 @@
"build:ui-react": "pnpm create:mapping-react && pnpm build:entry-react && pnpm build:react",
"pub:react": "pnpm --filter=\"./packages/dist-react/**\" publish --no-git-checks --access=public",
"dev:react-site": "pnpm --filter @opentiny/react-site start",
"build:react-site": "pnpm --filter @opentiny/react-site build"
"build:react-site": "pnpm --filter @opentiny/react-site build",
"commit": "git-cz"
},
"dependencies": {
"@vue/composition-api": "1.2.2",
@ -135,8 +137,6 @@
},
"devDependencies": {
"@antfu/eslint-config": "^0.38.6",
"@commitlint/cli": "^17.3.0",
"@commitlint/config-conventional": "^17.3.0",
"@types/color": "^3.0.3",
"@types/eslint": "^8.4.10",
"@types/node": "^18.11.18",
@ -159,7 +159,12 @@
"gulp-svg-inline": "^1.0.1",
"gulp-transform": "^3.0.5",
"lerna": "^6.4.0",
"lint-staged": "^13.0.3",
"lint-staged": "^15.2.0",
"husky": "^8.0.0",
"commitlint": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"minimist": "^1.2.8",
"node-xlsx": "^0.21.0",
"prettier": "^3.0.0",
@ -171,18 +176,6 @@
"vue": "^3.3.9",
"vue-tsc": "^1.6.5"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"lint-staged": {
"*.{js,ts,jsx,tsx,vue}": [
"prettier --write",
"eslint --fix"
]
},
"config": {
"commitizen": {
"path": "cz-conventional-changelog"