eslint-plugin-strict-booleans
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i eslint-plugin-strict-booleans

Weekly Downloads

268

Version

1.0.1

License

MIT

Unpacked Size

21 MB

Total Files

16

Last publish

Collaborators

  • vinceau