【问题标题】:change all eslint errors to warning instead of error using .eslintrc.js使用 .eslintrc.js 将所有 eslint 错误更改为警告而不是错误
【发布时间】:2021-03-04 22:23:42
【问题描述】:

有没有办法使用 eslintrc.js 文件将所有 eslint 错误更改为警告?

我现在只是讨厌它,尤其是当它停止整个程序时,因为我添加了一个额外的空间。

我想知道有没有办法关闭所有错误并让 prettier 处理代码的重新排列?

附:我使用 vscode 作为 IDE 和

我知道代码开头的注释。它不适用于 vue 或 nuxt 项目

【问题讨论】:

标签: eslint eslintrc


【解决方案1】:

如果您使用 ESLint 扩展,您可以使用设置 eslint.rules.customizations 自定义 ESLint 规则的严重性。

例如,如果您将以下 sn-p 添加到您的 .vscode/settings.json,则所有 ESLint 错误都将在 VSCode 中显示为警告。

"eslint.rules.customizations": [
  { "rule": "*", "severity": "warn" }
]

【讨论】:

    猜你喜欢
    • 2018-12-23
    • 2018-03-13
    • 2018-11-15
    • 2013-07-06
    • 2021-08-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    相关资源
    最近更新 更多