Commit b2a2ab16 authored by yanglilong's avatar yanglilong

style(custom): 代码格式化校验

parent 78ed6e85
module.exports = {
// 类型
types: [
{ value: 'feat', name: 'feat:新功能' },
{ value: 'fix', name: 'fix:修复' },
{ value: 'docs', name: 'docs:文档变更' },
{ value: 'style', name: 'style:代码格式化(不影响代码执行的变动)' },
{ value: 'refector', name: 'refector :功能重构' },
{ value: 'po', name: 'po:性能优化' },
{ value: 'test', name: 'test:测试' },
{ value: 'utils', name: 'utils:工具/插件变动' },
{ value: 'revert', name: 'revert:回退' },
{ value: 'build', name: 'build:构建 ' }
],
// 步骤
messages: {
type: '请选择提交类型:',
customScope: '请输入修改范围(可选):',
subject: '请简要描述提交(必填):',
body: '请输入详细描述(可选):',
footer: '请输入要关闭的任务编号/issue(可选)?',
confirmCommit: '确认使用以上信息提交(y/n)?'
},
// 指定忽略选项
skipQuestions: ['body'],
subjectLimit: 72
}
......@@ -12,6 +12,13 @@ module.exports = {
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"max-line-length": "off",
"object-property-newline": "off",
"prettier/prettier": "off"
'space-before-function-paren': 'off',
// 关闭驼峰命名
camelcase: 'off',
// 禁止不必要的转义字符
'no-useless-escape': 0,
eqeqeq: 'off',
'no-plusplus': 'off',
'new-cap': 'off'
},
};
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit $1
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
{
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true
}
......@@ -5,7 +5,8 @@
"scripts": {
"serve": "vue-cli-service serve --mode development",
"build": "vue-cli-service build --mode production --report",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"prepare": "husky install"
},
"dependencies": {
"ant-design-vue": "^1.7.8",
......@@ -15,6 +16,7 @@
"big.js": "^6.2.1",
"core-js": "^3.6.5",
"gm-crypt": "^0.0.2",
"husky": "^7.0.1",
"lodash": "^4.17.21",
"lodash-webpack-plugin": "^0.11.6",
"moment": "^2.29.1",
......@@ -23,9 +25,12 @@
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0",
"vuex-persistedstate": "^4.1.0"
"vuex-persistedstate": "^4.1.0",
"yorkie": "^2.0.0"
},
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
......@@ -34,14 +39,39 @@
"@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0",
"compression-webpack-plugin": "^6.1.1",
"cz-customizable": "^6.3.0",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^6.2.2",
"husky": "^7.0.1",
"lint-staged": "^9.5.0",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"prettier": "^2.2.1",
"style-resources-loader": "^1.5.0",
"vue-cli-plugin-style-resources-loader": "^0.1.5",
"vue-template-compiler": "^2.6.11"
},
"gitHooks": {
"pre-commit": "lint-staged"
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
"engines": {
"node": "16.14.0"
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment