Skip to content

Commit 8a0a224

Browse files
committed
Test already parenthesized and nested unary expression
1 parent a6a3b33 commit 8a0a224

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

test/prefer-bigint-literals.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,8 @@ test.snapshot({
9696
'+BigInt(1)',
9797
'+BigInt(-1)',
9898
'+BigInt("1")',
99+
100+
'1n - (( BigInt("-1") ))',
101+
'BigInt(-(+(-10)))',
99102
],
100103
});

test/snapshots/prefer-bigint-literals.js.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,3 +965,41 @@ Generated by [AVA](https://avajs.dev).
965965
Output:␊
966966
1 | +1n␊
967967
`
968+
969+
## invalid(50): 1n - (( BigInt("-1") ))
970+
971+
> Input
972+
973+
`␊
974+
1 | 1n - (( BigInt("-1") ))␊
975+
`
976+
977+
> Error 1/1
978+
979+
`␊
980+
Message:␊
981+
> 1 | 1n - (( BigInt("-1") ))␊
982+
| ^^^^^^^^^^^^ Prefer using bigint literal over \`BigInt(…)\`.␊
983+
984+
Output:␊
985+
1 | 1n - (( -1n ))␊
986+
`
987+
988+
## invalid(51): BigInt(-(+(-10)))
989+
990+
> Input
991+
992+
`␊
993+
1 | BigInt(-(+(-10)))␊
994+
`
995+
996+
> Error 1/1
997+
998+
`␊
999+
Message:␊
1000+
> 1 | BigInt(-(+(-10)))␊
1001+
| ^^^^^^^^^^^^^^^^^ Prefer using bigint literal over \`BigInt(…)\`.␊
1002+
1003+
Output:␊
1004+
1 | 10n␊
1005+
`
87 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)