eslint-plugin-typescript-extended-rules
v1.3.0
Published
Extended typescript rules for ESLint
Maintainers
Readme
eslint-plugin-typescript-extended-rules
Extended typescript rules for ESLint
Installation
You'll first need to install ESLint:
npm i -D eslintNext, install eslint-plugin-typescript-extended-rules:
npm install -D eslint-plugin-typescript-extended-rulesUsage
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-convention | Validates if the file name follows the allowed cases | | max-declarations-per-file | Declare the maximum classes, interfaces, enums, and types or the sum of all these per file | | no-empty-return | Avoid empty returns (return;) | | prefer-static-method | Use static methods in functions that do not access the global properties of a class |
