Skip to content
Permalink
main
Switch branches/tags
Go to file
* chore(website): generate rule docs options automatically

* Apply suggestions from code review

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

* First round of changes

* Simplify Prettier types

* Progress on using defs

* Progress, through the letter 'd' for rules

* Through explicit-module-boundary-types

* rip, ban-types defaults

* Cleaner separation for adding headers

* ...I meant headings

* Finished specifically base rule extensions

* Fix unit test, and enable debug cypress logging

* Fix deprecation notices, and ci.yml env indent

* Fix up lang and <sup>

* No, not sup

* Removed bunch more options docs cruft

* naming-convention, I give up

* Aha, a missing lint rule

* member-ordering, I give up on you too

* Several more docs automations

* Fixed options index

* Also above Related To

* Aha, jsx working

* Thanks lint - correct no-inferrable-types headings

* Update packages/eslint-plugin/src/rules/no-implicit-any-catch.ts

Co-authored-by: Brad Zacher <brad.zacher@gmail.com>

* Fix explicit-function-return-type

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Brad Zacher <brad.zacher@gmail.com>
7 contributors

Users who have contributed to this file

@JoshuaKGoldberg @bradzacher @armano2 @Josh-Cena @rhysd @jp7837 @JamesHenry
description
Disallow non-null assertions using the `!` postfix operator.

🛑 This file is source code, not the primary documentation location! 🛑

See https://typescript-eslint.io/rules/no-non-null-assertion for documentation.

Rule Details

Using non-null assertions cancels the benefits of the strict null-checking mode.

Examples of code for this rule:

Incorrect

interface Foo {
  bar?: string;
}

const foo: Foo = getFoo();
const includesBaz: boolean = foo.bar!.includes('baz');

Correct

interface Foo {
  bar?: string;
}

const foo: Foo = getFoo();
const includesBaz: boolean = foo.bar?.includes('baz') ?? false;

When Not To Use It

If you don't care about strict null-checking, then you will not need this rule.