Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
chore: add tests with computed expression
Browse files Browse the repository at this point in the history
  • Loading branch information
kaioduarte committed Nov 21, 2022
1 parent 03c4570 commit 5186531
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ class Case9 {
}

case10!!.prop = null;

case11!?.[computedField];

case12!?.[a.b!!];
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ class Case9 {

case10!!.prop = null;

case11!?.[computedField];

case12!?.[a.b!!];

```
# Diagnostics
Expand Down Expand Up @@ -237,6 +241,7 @@ invalid.ts:36:1 lint/nursery/noExtraNonNullAssertion FIXABLE ━━━━━
> 36 │ case10!!.prop = null;
^^^^^^^
37
38 │ case11!?.[computedField];

i Safe fix: Remove extra non-null assertion.

Expand All @@ -245,4 +250,22 @@ invalid.ts:36:1 lint/nursery/noExtraNonNullAssertion FIXABLE ━━━━━

```
```
invalid.ts:40:11 lint/nursery/noExtraNonNullAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

! Forbidden extra non-null assertion.

38 │ case11!?.[computedField];
39
> 40 │ case12!?.[a.b!!];
^^^^
41

i Safe fix: Remove extra non-null assertion.

40 │ case12!?.[a.b!!];
-

```

0 comments on commit 5186531

Please sign in to comment.