eslint-plugin-strict-booleans
v1.0.1
Published
No nullable numbers as booleans
Downloads
505
Readme
strict-booleans
Disallows nullable numbers to be used in boolean expressions. That's it.
Based on the @typescript-eslint/strict-boolean-expressions
rule.
Installation
With NPM
npm install --save-dev eslint eslint-plugin-strict-booleans
With Yarn
yarn add -D eslint eslint-plugin-strict-booleans
Usage
Add strict-booleans
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": ["strict-booleans"]
}
You may also need to set project
in the parserOptions
section of your .eslintrc
.
{
"parserOptions": {
"project": "tsconfig.json"
}
}
Then enable the rule:
{
"rules": {
"strict-booleans/no-nullable-numbers": "error"
}
}