简体   繁体   English

添加规则时出现 Eslint 错误 @typescript-eslint/interface-name-prefix

[英]Eslint erro when adding rule @typescript-eslint/interface-name-prefix

When I add the rule,当我添加规则时,

"@typescript-eslint/interface-name-prefix": [ "error", { "prefixWithI": "always" }]

give the following error message:给出以下错误信息:

Definition for rule '@typescript-eslint/interface-name-prefix' was not found.eslint(@typescript-eslint/interface-name-prefix)找不到规则“@typescript-eslint/interface-name-prefix”的定义。eslint(@typescript-eslint/interface-name-prefix)

The rule @typescript-eslint/interface-name-prefix has been removed as you can see here .如您在此处看到的,规则@typescript-eslint/interface-name-prefix已被删除。

You can achieve the same effect of [ "error", { "prefixWithI": "always" }] with the following:您可以使用以下内容实现与[ "error", { "prefixWithI": "always" }]相同的效果:

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 eslint 缩进和@typescript-eslint/indent 冲突 - eslint indent and @typescript-eslint/indent conflict ESLint 与 eslint-plugin-import 和 typescript-eslint 冲突 - ESLint conflicts with eslint-plugin-import and typescript-eslint 找不到与 @typescript-eslint/scope-manager@4.22.1 匹配的版本 - No matching version found for @typescript-eslint/scope-manager@4.22.1 @typescript-eslint/eslint-plugin@2.3.2:引擎“节点”与此模块不兼容 - @typescript-eslint/eslint-plugin@2.3.2: The engine “node” is incompatible with this module Typescript 节点快速路由器和第二个参数。 Typescript-eslint/无误用承诺 - Typescript node express router and second argument. Typescript-eslint/no-misused-promises ES2015 模块语法优于自定义 TypeScript 模块和命名空间@typescript-eslint/no-namespace - ES2015 module syntax is preferred over custom TypeScript modules and namespaces @typescript-eslint/no-namespace 纱线 - 错误找不到与“5.31.0”匹配的“@typescript-eslint/type-utils”的任何版本 - Yarn - error Couldn't find any versions for "@typescript-eslint/type-utils" that matches "5.31.0" npm 错误。 notarget 找不到与@typescript-eslint/parser@5.4.0 匹配的版本 - npm ERR! notarget No matching version found for @typescript-eslint/parser@5.4.0 已为@typescript-eslint/parser 设置解析错误“parserOptions.project” - Parsing error "parserOptions.project" has been set for @typescript-eslint/parser 带TypeScript的函数名称的ESlint规则(首字母小写的camelCase) - ESlint rule for function names with TypeScript (camelCase with lower case for first letter)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM