ESLint & husky & git commit limit
ESLint & husky & git commit limit
2 == error
.eslintrc
{
"extends": "eslint-config-umi",
"rules": {
"no-console": 2, //0,1,2
"no-debugger": 0,
"no-unused-vars": 2,
"quotes": 0,
"semi": 2,
"eqeqeq": 0,
"no-fallthrough": 0,
// 'prefer-arrow-callback': 2,
// 'arrow-spacing': 2,
// 'react/prefer-es6-class': 2,
"react/prefer-stateless-function": 2,
"react/jsx-pascal-case": 2,
"no-multi-spaces": 2,
"react/jsx-tag-spacing": 2,
"react/jsx-curly-spacing": 2,
"react/jsx-boolean-value": 2, //
"react/jsx-wrap-multilines": 2 // 将多行的JSX标签写在 ()里
// 'react/jsx-filename-extension': [1, { extensions: ['.js'] }],
// 'react/jsx-wrap-multilines': 0,
// 'react/prop-types': 0,
// 'react/forbid-prop-types': 0,
// 'react/jsx-one-expression-per-line': 0,
// 'import/no-unresolved': [2, { ignore: ['^@/', '^umi/'] }],
// 'import/no-extraneous-dependencies': [2, { optionalDependencies: true }],
// 'jsx-a11y/no-noninteractive-element-interactions': 0,
// 'jsx-a11y/click-events-have-key-events': 0,
// 'jsx-a11y/no-static-element-interactions': 0,
// 'jsx-a11y/anchor-is-valid': 0
// "no-return-assign": 0,
}
}
husky 沙哑的
https://www.npmjs.com/package/husky
Husky 工作原理是什么? 自动读取 eslint 的配置文件,作为自己的配置文件?
https://github.com/typicode/husky
Husky
哈士奇
.huskyrc.json
git hook
Husky 工作原理
https://zhuanlan.zhihu.com/p/35913229
ESLint, 0, 1, 2
https://eslint.org/docs/user-guide/getting-started
https://www.cnblogs.com/xgqfrms/p/11064277.html
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/11650177.html
未经授权禁止转载,违者必究!