feat: 添加commit校验

This commit is contained in:
xieyonghong 2023-01-10 15:26:20 +08:00
parent 5aeeda5433
commit 3fba23e19f
5 changed files with 4333 additions and 1235 deletions

28
.commitlintrc.cjs Normal file
View File

@ -0,0 +1,28 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'build', // 编译相关修改(新版本发布)
'feat', // 新功能
'fix', // 修复bug
'update', // 更新某功能
'refactor', // 重构
'docs', // 文档
'chore', // 增加依赖或库
'style', // 格式(不影响代码变动)
'revert', // 撤销commit 回滚上一版本
'perf', // 性能优化
]
],
'type-case': [0],
'type-empty': [0],
'scope-empty': [0],
'scope-case': [0],
'subject-full-stop': [0, 'never'],
'subject-case': [0, 'never'],
'header-max-length': [0, 'always', 72]
}
}

4
.husky/commit-msg Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit ${1}

30
components.d.ts vendored
View File

@ -1,22 +1,22 @@
// generated by unplugin-vue-components // generated by unplugin-vue-components
// We suggest you to commit this file into source control // We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core' import '@vue/runtime-core';
export {} export {};
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
export interface GlobalComponents { export interface GlobalComponents {
ACard: typeof import('ant-design-vue/es')['Card'] ACard: typeof import('ant-design-vue/es')['Card'];
ACol: typeof import('ant-design-vue/es')['Col'] ACol: typeof import('ant-design-vue/es')['Col'];
ARow: typeof import('ant-design-vue/es')['Row'] ARow: typeof import('ant-design-vue/es')['Row'];
ATooltip: typeof import('ant-design-vue/es')['Tooltip'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'];
BadgeStatus: typeof import('./src/components/BadgeStatus/index.vue')['default'] BadgeStatus: typeof import('./src/components/BadgeStatus/index.vue')['default'];
CardBox: typeof import('./src/components/CardBox/index.vue')['default'] CardBox: typeof import('./src/components/CardBox/index.vue')['default'];
GeoComponent: typeof import('./src/components/GeoComponent/index.vue')['default'] GeoComponent: typeof import('./src/components/GeoComponent/index.vue')['default'];
MonacoEditor: typeof import('./src/components/MonacoEditor/index.vue')['default'] MonacoEditor: typeof import('./src/components/MonacoEditor/index.vue')['default'];
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink'];
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView'];
ValueItem: typeof import('./src/components/ValueItem/index.vue')['default'] ValueItem: typeof import('./src/components/ValueItem/index.vue')['default'];
} }
} }

View File

@ -8,7 +8,9 @@
"build": "vite build --mode production", "build": "vite build --mode production",
"preview": "vite preview", "preview": "vite preview",
"eslint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src", "eslint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
"prettier": "prettier --write" "lint": "eslint src --fix --ext .ts,.tsx,.vue,.js,.jsx",
"prettier": "prettier --write",
"prepare": "husky install"
}, },
"dependencies": { "dependencies": {
"@vuemap/vue-amap": "^1.1.20", "@vuemap/vue-amap": "^1.1.20",
@ -26,16 +28,31 @@
"vue-router": "^4.1.6" "vue-router": "^4.1.6"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^17.4.1",
"@commitlint/config-conventional": "^17.4.0",
"@types/lodash-es": "^4.17.6", "@types/lodash-es": "^4.17.6",
"@types/moment": "^2.13.0", "@types/moment": "^2.13.0",
"@types/node": "^18.11.17", "@types/node": "^18.11.17",
"@vitejs/plugin-vue": "^4.0.0", "@vitejs/plugin-vue": "^4.0.0",
"@vuemap/unplugin-resolver": "^1.0.4", "@vuemap/unplugin-resolver": "^1.0.4",
"autoprefixer": "^10.4.13", "autoprefixer": "^10.4.13",
"commitlint": "^17.4.1",
"husky": "^8.0.0",
"lint-staged": "^13.1.0",
"mrm": "^4.1.13",
"prettier": "^2.8.1", "prettier": "^2.8.1",
"typescript": "^4.9.3", "typescript": "^4.9.3",
"vite": "^4.0.0", "vite": "^4.0.0",
"vite-plugin-html": "^3.2.0", "vite-plugin-html": "^3.2.0",
"vue-tsc": "^1.0.11" "vue-tsc": "^1.0.11"
},
"lint-staged": {
"**/*.{vue,js,jsx,ts,tsx}": [
"npm run lint",
"prettier --write"
],
"**/*.{html,css,less,md}": [
"prettier --write"
]
} }
} }

5487
yarn.lock

File diff suppressed because it is too large Load Diff