1.2.1 • Published 7 years ago
pre-commit-eslint-vue v1.2.1
Pre-commit-ESLint
原理
pre-commit-eslint 利用 git hook,安装后在项目的 .git
目录下添加一个 pre-commit-hook 对更改的 JS 文件使用 eslint 检查。
安装
npm install pre-commit-eslint-vue --dev
FAQ
安装后并提交 commit 没有生效
首先在项目根目录执行 cat ./git/hooks/pre-commit
确认 hook 已经存在,不存在的话目前一个常见情况是 yarn 的某些版本并不会在安装后执行 postinstall
hook。
解决方案:安装后执行 node ./node_modules/pre-commit-eslint/index.js
即可。
License
MIT ©