detachhead's eslint rules
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"]
}
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"
}
}
Name | Description |
---|---|
require-variance-annotations | enforce variance annotations for all generics where they are supported. |
suggestions-as-errors | report typescript suggestions as errors |