【发布时间】:2021-06-18 19:38:29
【问题描述】:
使用 Webpack 为 Eslint plugin 正确设置选项很热门?
这是我的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 选项应用于此插件。
【问题讨论】:
-
您传递的选项无效,它们将进入您的 .eslintrc 文件。请参阅此处了解您可以在插件中传递的有效选项。 eslint.org/docs/developer-guide/nodejs-api#-new-eslintoptions
标签: javascript node.js npm webpack eslint