Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nwtgck/eslint-plugin-exaggerated-non-null-assertion
Exaggerated Non-Null Assertion
https://github.com/nwtgck/eslint-plugin-exaggerated-non-null-assertion
eslint linter non-null-assertion typescript-eslint
Last synced: 14 days ago
JSON representation
Exaggerated Non-Null Assertion
- Host: GitHub
- URL: https://github.com/nwtgck/eslint-plugin-exaggerated-non-null-assertion
- Owner: nwtgck
- License: mit
- Created: 2020-06-07T06:00:00.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2020-06-07T06:45:14.000Z (over 4 years ago)
- Last Synced: 2024-10-11T15:09:52.405Z (28 days ago)
- Topics: eslint, linter, non-null-assertion, typescript-eslint
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eslint-plugin-exaggerated-non-null-assertion
## Rule Details
Example of **incorrect** code for this rule:
```ts
const foo: number | undefined = undefined;
const bar = foo!;
```Example of **correct** code for this rule:
```ts
const foo: number | undefined = undefined;
const bar = foo!!!;
```## Installation
```bash
npm i -D nwtgck/eslint-plugin-exaggerated-non-null-assertion
```Add the following settings to `.eslintrc.js` or the other ESLint setting file.
```js
...
"plugins": [
...
"exaggerated-non-null-assertion"
],
``````js
...
"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.