Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 640
Wilson Matokanovic Junior Avatar asked Jul 15 '20 12:07

Wilson Matokanovic Junior


1 Answers

The rule @typescript-eslint/interface-name-prefix has been removed as you can see here.

You can achieve the same effect of [ "error", { "prefixWithI": "always" }] with the following:

{
  "@typescript-eslint/naming-convention": [
    "error",
    {
      "selector": "interface",
      "format": ["PascalCase"],
      "custom": {
        "regex": "^I[A-Z]",
        "match": true
      }
    }
  ]
}
like image 198
Telmo Trooper Avatar answered Nov 01 '22 15:11

Telmo Trooper