We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
# 安装钩子 npm install --save-dev husky # 安装eslint npm install --save-dev eslint babel-eslint
在项目的package.json中添加提交校验脚本
package.json
precommit
prepush
eslint_fix
{ "scripts": { "precommit": "./node_modules/.bin/eslint --ext .jsx,.js ./", "prepush": "./node_modules/.bin/eslint --ext .jsx,.js ./", "eslint_fix": "./node_modules/.bin/eslint --fix --ext .jsx,.js ./" }, }
.eslintrc
.eslintrc.js
在项目根目录下新建 .eslintignore 文件,具体忽略写法与.gitignore的写法一致
.eslintignore
.gitignore
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1. 安装相关模块
2. 配置脚本
在项目的
package.json
中添加提交校验脚本precommit
是作为git commit 前校验prepush
是作为git push 前校验eslint_fix
自定义脚本,是用来执行自动eslint修复用的自定义脚本3. 其他
配置eslint规则
.eslintrc
或者.eslintrc.js
这两种文件都可以支持配置eslint忽略文件
在项目根目录下新建
.eslintignore
文件,具体忽略写法与.gitignore
的写法一致The text was updated successfully, but these errors were encountered: