Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8ff5de

Browse files
authored
docs(eslint-plugin): [no-non-null-assertion] correct example (typescript-eslint#2188)
1 parent 43ee226 commit d8ff5de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/eslint-plugin/docs/rules/no-non-null-assertion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ interface Foo {
2323
}
2424

2525
const foo: Foo = getFoo();
26-
const includesBaz: boolean = foo.bar && foo.bar.includes('baz');
26+
const includesBaz: boolean = foo.bar?.includes('baz') ?? false;
2727
```
2828

2929
## When Not To Use It

0 commit comments

Comments
 (0)