1.0.1 • Published 4 years ago

eslint-plugin-strict-booleans v1.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

strict-booleans

npm version Build Status

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"
  }
}