Commit 033ea05c by luojie

update: 提交

parent 9eb8c1c3
#!/bin/sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}
readonly hook_name="$(basename "$0")"
debug "starting $hook_name..."
if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi
if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi
export readonly husky_skip_init=1
sh -e "$0" "$@"
exitCode="$?"
if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi
exit $exitCode
fi
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit "$1"
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
...@@ -90,7 +90,9 @@ module.exports = { ...@@ -90,7 +90,9 @@ module.exports = {
new ESLintPlugin({ new ESLintPlugin({
extensions: ['js', 'vue'], extensions: ['js', 'vue'],
files: 'src', files: 'src',
fix: true fix: true,
lintDirtyModulesOnly: true,
formatter: "visualstudio"
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
template: 'index.html', template: 'index.html',
......
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [2, 'always', [
'update', 'feat', 'fix', 'refactor', 'docs', 'chore', 'style', 'revert', 'build'
]]
}
}
module.exports = {
'src/**/*.{js,vue}': 'eslint'
}
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
"dev": "webpack server --env NODE_ENV=development --progress --config build/webpack.dev.conf.js", "dev": "webpack server --env NODE_ENV=development --progress --config build/webpack.dev.conf.js",
"start": "npm run dev", "start": "npm run dev",
"build": "node build/build.js", "build": "node build/build.js",
"format": "onchange 'test/**/*.js' 'src/**/*.js' 'src/**/*.vue' -- prettier --write {{changed}}" "prepare": "husky install"
}, },
"dependencies": { "dependencies": {
"@antv/data-set": "^0.8.9", "@antv/data-set": "^0.8.9",
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
"@babel/core": "7.16.0", "@babel/core": "7.16.0",
"@babel/eslint-parser": "7.16.3", "@babel/eslint-parser": "7.16.3",
"@babel/preset-env": "7.16.0", "@babel/preset-env": "7.16.0",
"@commitlint/cli": "^14.1.0",
"@commitlint/config-conventional": "^14.1.0",
"@soda/friendly-errors-webpack-plugin": "^1.8.0", "@soda/friendly-errors-webpack-plugin": "^1.8.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.2.1", "@vue/babel-helper-vue-jsx-merge-props": "^1.2.1",
"@vue/babel-preset-jsx": "^1.2.4", "@vue/babel-preset-jsx": "^1.2.4",
...@@ -58,6 +60,8 @@ ...@@ -58,6 +60,8 @@
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^8.0.3",
"eslint-webpack-plugin": "^3.1.1", "eslint-webpack-plugin": "^3.1.1",
"html-webpack-plugin": "5.5.0", "html-webpack-plugin": "5.5.0",
"husky": "^7.0.0",
"lint-staged": "^12.0.2",
"mini-css-extract-plugin": "2.4.4", "mini-css-extract-plugin": "2.4.4",
"node-notifier": "10.0.0", "node-notifier": "10.0.0",
"node-sass": "4.14.1", "node-sass": "4.14.1",
......
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