eslint-plugin-typescript-inheritance
v1.0.1
Published
ESLint typescript plugin to control class inheritance
Downloads
11
Maintainers
Readme
eslint-plugin-typescript-inheritance
ESLint typescript plugin to control inheritance. By default it forbids all inheritance except inheritance of abstract classes. See rule description for the details.
Installation
:warning: This tutorial implies that typescript-eslint is installed and linting with type information is set up
npm install eslint-plugin-typescript-inheritance --save-dev
Note: If you installed ESLint globally then you must also install eslint-plugin-typescript-inheritance
globally.
Usage
Add typescript-inheritance
to the plugins section. You can omit the eslint-plugin-
prefix:
{
"plugins": ["typescript-inheritance"]
}
Then enable all rules with recommended configuration:
{
"extends": ["plugin:typescript-inheritance/recommended"]
}
Or configure the rules you want to use under the rules section:
{
"rules": {
"typescript-inheritance/no-class-inheritance": ["error"]
}
}
Supported Rules
| Name | Description |
| ------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| typescript-inheritance/no-class-inheritance
| Forbids usage of class inheritance except inheritance of abstract classes (by default) |