使用Webpack为Eslint插件正确设置选项很热门?
这是我的webpack.config.js
文件:
const path = require('path');
const ESLintPlugin = require('eslint-webpack-plugin');
module.exports = {
plugins: [new ESLintPlugin({
"skipBlankLines": true,
"ignoreComments": true
})],
}
它抛出了一个错误:
ERROR in Invalid Options:
- Unknown options: skipBlankLines, ignoreComments
我需要禁用no-undef
,将max-len
设置为120个字符,并将indent
更改为tab
。
我在文档中找不到任何信息,也无法将Eslint-doc选项应用于此插件。
skipBlankLines
和ignoreComments
不是eslint-webpack-plugin
的有效选项参考:文档
如果要禁用no-undef
,请将max-len
设置为120个字符,并将indent
更改为tab
将其添加到规则部分的.eslintrc
文件中。
"rules": {
"no-undef": "off",
"max-len": ["error", { "code": 120 }],
"indent": ["error", "tab"]
....
}