在 webpack 1.x 中,我可以在我的 webpack 配置中使用 eslint 属性来启用自动修复我的 linting 错误,方法是:
...
module.exports = {
devtool: 'source-map',
entry: './src/app.js',
eslint: {
configFile: '.eslintrc',
fix: true
},
...
然而,在 webpack 2.x 中,到目前为止我一直无法使用自动修复功能,因为我不知道在我的 webpack 配置中设置它的位置。在我的 webpack configFile 中使用 eslint 属性会抛出一个WebpackOptionsValidationError
.