node.js - 添加规则时 Eslint 错误 @typescript-eslint/interface-name-prefix

标签 node.js typescript eslint

当我添加规则时,

"@typescript-eslint/interface-name-prefix": [ "error", { "prefixWithI": "always" }]
给出以下错误信息:
未找到规则“@typescript-eslint/interface-name-prefix”的定义。eslint(@typescript-eslint/interface-name-prefix)

最佳答案

规则@typescript-eslint/interface-name-prefix如您所见,已被删除 here .
可以达到与[ "error", { "prefixWithI": "always" }]相同的效果具有以下内容:

{
  "@typescript-eslint/naming-convention": [
    "error",
    {
      "selector": "interface",
      "format": ["PascalCase"],
      "custom": {
        "regex": "^I[A-Z]",
        "match": true
      }
    }
  ]
}

关于node.js - 添加规则时 Eslint 错误 @typescript-eslint/interface-name-prefix,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62915344/

相关文章:

javascript - 如何使用 Node 计划在指定时间运行任务?

node.js - 如何在每半夜运行nodejs程序?

Javascript/node.js - 将值返回给父函数

angular - 不能在 Angular 6 的子模块中使用在应用程序模块内声明的指令

npm - 仅在特定文件上自动修复 lint 问题

javascript - 如何在 Visual Studio 2017 中禁用 JavaScript 构建错误?

Node.js worker /后台进程

typescript - 如何在 TypeScript 中显式设置 `window` 上的新属性?

javascript - 如何使用 Q 保留对 promise 链的响应

javascript - 如何在 HTML 脚本标签 JS 上运行 Gulp ESLint