In your js project directory:
npm install --save-dev eslint-config-app
git提供了hook功能,在提交代码(commit)前触发执行脚本
husky方便的为项目接入git hook
使用:
安装husky npm i --save-dev husky
在package.json中定义
"scripts": {
"precommit": "eslint ."
}
unable to resolve to path to module 'xxx'
安装eslint-import-resolver-webpack package 在当前项目.eslintrc.js文件中加上
settings: {
'import/resolver': {
webpack: {
//为webpack的文件路径
config: 'build/webpack.config.dev.babel.js',
},
},
},
'import/first': ['error', 'DISABLE-absolute-first'],