[英]Webpack: how to set eslint-webpack-plugin rules?
熱到使用 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 文檔選項應用於此插件。
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"]
....
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.