/eslint-plugin-detachhead

my custom typescript eslint rules

Primary LanguageTypeScript

eslint-plugin-detachhead

detachhead's eslint rules

Installation & Usage

method 1 (recommended) - @detachhead/eslint-config

it's recommended to use my @detachhead/eslint-config as it includes all of the eslint plugins & rules that i recommend. this plugin only contains rules i made myself and is intended to be used along with my config

npm install @detachhead/eslint-config --save-dev

then extend the config in your .eslintrc file:

{
    "extends": ["@detachhead/eslint-config"]
}

method 2 - just the plugin

npm install eslint-plugin-detachhead --save-dev

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

{
    "plugins": ["detachhead"]
}

then enable all rules by extending the "all" config:

{
    "extends": ["detachhead/all"]
}

or configure individual rules you want to use under the rules section:

{
    "rules": {
        "detachhead/require-variance-annotations": "error"
    }
}

Rules

Name                         Description
require-variance-annotations enforce variance annotations for all generics where they are supported.
suggestions-as-errors report typescript suggestions as errors