Skip to content

nwtgck/eslint-plugin-exaggerated-non-null-assertion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eslint-plugin-exaggerated-non-null-assertion

Rule Details

Example of incorrect code for this rule:

const foo: number | undefined = undefined;
const bar = foo!;

Example of correct code for this rule:

const foo: number | undefined = undefined;
const bar = foo!!!;

Installation

npm i -D nwtgck/eslint-plugin-exaggerated-non-null-assertion

Add the following settings to .eslintrc.js or the other ESLint setting file.

    ...
    "plugins": [
      ...
      "exaggerated-non-null-assertion"
    ],
  ...
  "rules": {
    ...
    // NOTE: Disable no-extra-non-null-assertion and no-non-null-assertion
    "@typescript-eslint/no-extra-non-null-assertion": "off",
    "@typescript-eslint/no-non-null-assertion": "off",
    // Enable Exaggerated Non-Null Assertion
    "exaggerated-non-null-assertion/exaggerated-non-null-assertion": "error",
  }

Example

Here is an example using this lint. https://github.com/nwtgck/eslint-plugin-exaggerated-non-null-assertion-example

Releases

No releases published

Packages

No packages published