1.3.0 • Published 2 years ago

eslint-plugin-typescript-extended-rules v1.3.0

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
2 years ago

eslint-plugin-typescript-extended-rules

Extended typescript rules for ESLint

Installation

You'll first need to install ESLint:

npm i -D eslint

Next, install eslint-plugin-typescript-extended-rules:

npm install -D eslint-plugin-typescript-extended-rules

Usage

Add typescript-extended-rules to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["typescript-extended-rules"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "typescript-extended-rules/file-naming-convention": [
      "error",
      {
        allowedCases: ["kebab-case"],
      },
    ],
    "typescript-extended-rules/max-declarations-per-file": [
      "error",
      {
        "maxDeclarations": 1
      }
    ],
    "typescript-extended-rules/no-empty-return": "error",
    "typescript-extended-rules/prefer-static-method": ["error",  {"exceptMethods": ["foo"], "exceptFilenamesPattern": [/\.bar\./, /^zoo$/]}],
  }
}

Rules

⚠️ If you are in npmjs.com site, then use this link to see the rules.

Name                     Description
file-naming-conventionValidates if the file name follows the allowed cases
max-declarations-per-fileDeclare the maximum classes, interfaces, enums, and types or the sum of all these per file
no-empty-returnAvoid empty returns (return;)
prefer-static-methodUse static methods in functions that do not access the global properties of a class
1.3.0

2 years ago

1.2.0

2 years ago

1.2.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago