标签:roo env pre code 删除 dev stand ext lin
eslint-standard
vue create eslint-standard
.eslintrc.*
删除package.json
中的eslintConfig
配置
.eslintrc.js
// .eslintrc.js
module.exports = {
root: true,
env: {
node: true,
browser: true,
es6: true
},
extends: [
"plugin:vue/essential",
"eslint:recommended"
],
parserOptions: {
"parser": "babel-eslint"
},
rules: {} // 用来自定义一些符合个人或者团队的规则
}
husky
// 安装husky
npm install husky --save-dev
// 安装lint-staged,只对修改的文件进行check
npm install lint-staged --save-dev
//配置package.json,添加`husky`配置
{
"husky": {
"hooks": {
"pre-commit": "lint-staged",
}
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
}
}
Vue+ESLint+Git钩子函数pre-commit配置教程
标签:roo env pre code 删除 dev stand ext lin
原文地址:https://www.cnblogs.com/huiwenhua/p/12218371.html