|
1 | 1 | --- |
2 | 2 | source: crates/biome_js_analyze/tests/spec_tests.rs |
3 | | -assertion_line: 151 |
4 | 3 | expression: invalid.ts |
5 | 4 | --- |
6 | 5 | # Input |
@@ -61,6 +60,10 @@ arr1[0]!! ^= arr1[1]; |
61 | 60 | const arr2: number[] = [1, 2, 3]; |
62 | 61 | arr2[0] ^= arr2[1]!!; |
63 | 62 |
|
| 63 | +// Test case for issue #8475 |
| 64 | +const _d2 = (blob.b!)!.d!.length; |
| 65 | +const _d2 = ((blob.b!))!.d!.length; |
| 66 | +
|
64 | 67 | ``` |
65 | 68 |
|
66 | 69 | # Diagnostics |
@@ -407,10 +410,47 @@ invalid.ts:55:12 lint/suspicious/noExtraNonNullAssertion FIXABLE ━━━━ |
407 | 410 | > 55 │ arr2[0] ^= arr2[1]!!; |
408 | 411 | │ ^^^^^^^^ |
409 | 412 | 56 │ |
| 413 | + 57 │ // Test case for issue #8475 |
410 | 414 | |
411 | 415 | i Safe fix: Remove extra non-null assertion. |
412 | 416 | |
413 | 417 | 55 │ arr2[0]·^=·arr2[1]!!; |
414 | 418 | │ - |
415 | 419 |
|
416 | 420 | ``` |
| 421 | +
|
| 422 | +``` |
| 423 | +invalid.ts:58:14 lint/suspicious/noExtraNonNullAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 424 | +
|
| 425 | + ! Forbidden extra non-null assertion. |
| 426 | + |
| 427 | + 57 │ // Test case for issue #8475 |
| 428 | + > 58 │ const _d2 = (blob.b!)!.d!.length; |
| 429 | + │ ^^^^^^^ |
| 430 | + 59 │ const _d2 = ((blob.b!))!.d!.length; |
| 431 | + 60 │ |
| 432 | + |
| 433 | + i Safe fix: Remove extra non-null assertion. |
| 434 | + |
| 435 | + 58 │ const·_d2·=·(blob.b!)!.d!.length; |
| 436 | + │ - |
| 437 | +
|
| 438 | +``` |
| 439 | +
|
| 440 | +``` |
| 441 | +invalid.ts:59:15 lint/suspicious/noExtraNonNullAssertion FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 442 | +
|
| 443 | + ! Forbidden extra non-null assertion. |
| 444 | + |
| 445 | + 57 │ // Test case for issue #8475 |
| 446 | + 58 │ const _d2 = (blob.b!)!.d!.length; |
| 447 | + > 59 │ const _d2 = ((blob.b!))!.d!.length; |
| 448 | + │ ^^^^^^^ |
| 449 | + 60 │ |
| 450 | + |
| 451 | + i Safe fix: Remove extra non-null assertion. |
| 452 | + |
| 453 | + 59 │ const·_d2·=·((blob.b!))!.d!.length; |
| 454 | + │ - |
| 455 | +
|
| 456 | +``` |
0 commit comments