Commit 9a6458d5 authored by yanglilong's avatar yanglilong

Merge branch 'yll-0109' into 'master'

代码格式化校验

See merge request !84
parents 78ed6e85 b2caa3f8
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 = { ...@@ -12,6 +12,13 @@ module.exports = {
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"max-line-length": "off", "max-line-length": "off",
"object-property-newline": "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 @@ ...@@ -5,7 +5,8 @@
"scripts": { "scripts": {
"serve": "vue-cli-service serve --mode development", "serve": "vue-cli-service serve --mode development",
"build": "vue-cli-service build --mode production --report", "build": "vue-cli-service build --mode production --report",
"lint": "vue-cli-service lint" "lint": "vue-cli-service lint",
"prepare": "husky install"
}, },
"dependencies": { "dependencies": {
"ant-design-vue": "^1.7.8", "ant-design-vue": "^1.7.8",
...@@ -15,6 +16,7 @@ ...@@ -15,6 +16,7 @@
"big.js": "^6.2.1", "big.js": "^6.2.1",
"core-js": "^3.6.5", "core-js": "^3.6.5",
"gm-crypt": "^0.0.2", "gm-crypt": "^0.0.2",
"husky": "^7.0.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"lodash-webpack-plugin": "^0.11.6", "lodash-webpack-plugin": "^0.11.6",
"moment": "^2.29.1", "moment": "^2.29.1",
...@@ -23,9 +25,12 @@ ...@@ -23,9 +25,12 @@
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-router": "^3.2.0", "vue-router": "^3.2.0",
"vuex": "^3.4.0", "vuex": "^3.4.0",
"vuex-persistedstate": "^4.1.0" "vuex-persistedstate": "^4.1.0",
"yorkie": "^2.0.0"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0", "@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0", "@vue/cli-plugin-router": "~4.5.0",
...@@ -34,14 +39,39 @@ ...@@ -34,14 +39,39 @@
"@vue/eslint-config-prettier": "^6.0.0", "@vue/eslint-config-prettier": "^6.0.0",
"babel-eslint": "^10.1.0", "babel-eslint": "^10.1.0",
"compression-webpack-plugin": "^6.1.1", "compression-webpack-plugin": "^6.1.1",
"cz-customizable": "^6.3.0",
"eslint": "^6.7.2", "eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.3.1", "eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^6.2.2",
"husky": "^7.0.1",
"lint-staged": "^9.5.0",
"less": "^3.0.4", "less": "^3.0.4",
"less-loader": "^5.0.0", "less-loader": "^5.0.0",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"style-resources-loader": "^1.5.0", "style-resources-loader": "^1.5.0",
"vue-cli-plugin-style-resources-loader": "^0.1.5", "vue-cli-plugin-style-resources-loader": "^0.1.5",
"vue-template-compiler": "^2.6.11" "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"
} }
} }
...@@ -4,6 +4,10 @@ ...@@ -4,6 +4,10 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta http-equiv="Expires" content="0" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-control" content="no-cache" />
<meta http-equiv="Cache" content="no-cache" />
<link rel="icon" href="<%= BASE_URL %>favicon.png" /> <link rel="icon" href="<%= BASE_URL %>favicon.png" />
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<script <script
...@@ -14,9 +18,8 @@ ...@@ -14,9 +18,8 @@
<body> <body>
<noscript> <noscript>
<strong <strong
>We're sorry but <%= webpackConfig.name %> doesn't work >We're sorry but <%= webpackConfig.name %> doesn't work properly without
properly without JavaScript enabled. Please enable it to JavaScript enabled. Please enable it to continue.</strong
continue.</strong
> >
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
......
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