Skip to content

Commit

Permalink
ci(eslint): add husky and commitlint to eslint code (opentiny#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr authored Dec 4, 2023
1 parent fa0c40a commit 532c011
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx,vue}": ["prettier --write", "eslint --fix"],
"*.md": ["prettier --write"]
}
2 changes: 1 addition & 1 deletion commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }
module.exports = { extends: ['@commitlint/config-conventional'] }
25 changes: 9 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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"
Expand Down

0 comments on commit 532c011

Please sign in to comment.