Skip to content

Commit 0957b96

Browse files
committed
chore(deps): upgrade Biome
1 parent dd11358 commit 0957b96

File tree

10 files changed

+94
-88
lines changed

10 files changed

+94
-88
lines changed

biome.json

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,57 @@
11
{
2-
"$schema": "https://next.biomejs.dev/schemas/2.2.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
33
"root": true,
44
"files": {
55
"ignoreUnknown": true
66
},
77
"formatter": {
8-
"includes": [
9-
"**",
10-
"!tests-corpus/**"
11-
],
128
"indentStyle": "space",
139
"indentWidth": 4
1410
},
1511
"linter": {
1612
"domains": {
1713
"project": "recommended",
18-
"test": "recommended"
14+
"test": "recommended",
15+
"types": "recommended"
1916
},
2017
"rules": {
2118
"complexity": {
2219
"noImplicitCoercions": "on",
23-
"noUselessLoneBlockStatements": "off",
24-
"noVoid": "on"
20+
"noUselessCatchBinding": "on",
21+
"noUselessLoneBlockStatements": "on",
22+
"noUselessUndefined": "on",
23+
"noVoid": "on",
24+
"useWhile": "on"
2525
},
2626
"nursery": {
27-
"noDeprecatedImports": "on",
28-
"noDuplicateDependencies": "on",
29-
"noImportCycles": "on",
30-
"noUselessUndefined": "off",
31-
"useExhaustiveSwitchCases": "off",
27+
"useExhaustiveSwitchCases": "on",
3228
"useExplicitType": "off"
3329
},
3430
"performance": {
3531
"noDelete": "on"
3632
},
3733
"style": {
3834
"noDefaultExport": "on",
35+
"noExportedImports": "on",
3936
"noImplicitBoolean": "on",
4037
"noInferrableTypes": "on",
4138
"noNamespace": "on",
4239
"noNegationElse": "on",
4340
"noParameterAssign": "on",
4441
"noParameterProperties": "on",
42+
"noSubstr": "on",
4543
"noUnusedTemplateLiteral": "on",
4644
"noUselessElse": "on",
4745
"noYodaExpression": "on",
4846
"useAsConstAssertion": "on",
4947
"useBlockStatements": "on",
5048
"useCollapsedElseIf": "on",
49+
"useCollapsedIf": "on",
5150
"useConsistentArrayType": "on",
51+
"useConsistentArrowReturn": "on",
5252
"useConsistentBuiltinInstantiation": "on",
53+
"useConsistentMemberAccessibility": "on",
54+
"useConsistentObjectDefinitions": "on",
5355
"useConst": "on",
5456
"useDefaultParameterLast": "on",
5557
"useEnumInitializers": "on",
@@ -93,12 +95,13 @@
9395
},
9496
"useNodeAssertStrict": "on",
9597
"useNumberNamespace": "on",
96-
"useNumericSeparators": "off",
98+
"useNumericSeparators": "on",
9799
"useReadonlyClassProperties": "on",
98100
"useShorthandAssign": "on",
99101
"useSingleVarDeclarator": "on",
100102
"useThrowNewError": "on",
101103
"useThrowOnlyError": "on",
104+
"useTrimStartEnd": "on",
102105
"useUnifiedTypeSignatures": "on"
103106
},
104107
"suspicious": {
@@ -113,18 +116,18 @@
113116
}
114117
},
115118
"noConstantBinaryExpressions": "on",
119+
"noDeprecatedImports": "on",
120+
"noDuplicateDependencies": "on",
116121
"noEmptyBlockStatements": "on",
117122
"noEvolvingTypes": "on",
118123
"noExportsInTest": "on",
124+
"noImportCycles": "on",
119125
"noUnassignedVariables": "on",
126+
"noUnusedExpressions": "on",
120127
"noUselessEscapeInString": "on",
121128
"noVar": "on",
122129
"useErrorMessage": "on",
123130
"useNumberToFixedDigitsArgument": "on"
124-
},
125-
"correctness": {
126-
"noInvalidUseBeforeDeclaration": "off",
127-
"useJsonImportAttributes": "on"
128131
}
129132
}
130133
},

package-lock.json

Lines changed: 37 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"version": "sh ./scripts/version.sh"
7171
},
7272
"devDependencies": {
73-
"@biomejs/biome": "2.3.12",
73+
"@biomejs/biome": "2.4.4",
7474
"@types/node": "22.18.13",
7575
"esbuild": "0.27.2",
7676
"typescript": "5.9.3"

src/codec/fixed-primitive.test.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ test("writeI16", () => {
258258

259259
test("readI32", () => {
260260
const bc = fromBytes(0xb2, 0x9e, 0x43, 0xff)
261-
assert.deepEqual(readI32(bc), -12345678)
261+
assert.deepEqual(readI32(bc), -12_345_678)
262262
assert.throws(
263263
() => readI32(bc),
264264
{ name: "BareError", issue: "missing bytes", offset: 4 },
@@ -269,7 +269,7 @@ test("readI32", () => {
269269
test("writeI32", () => {
270270
{
271271
const bc = fromBytes()
272-
writeI32(bc, -12345678)
272+
writeI32(bc, -12_345_678)
273273
assert.deepEqual(toBytes(bc), [0xb2, 0x9e, 0x43, 0xff])
274274
}
275275

@@ -304,7 +304,10 @@ test("writeI32", () => {
304304
}
305305
})
306306

307-
const BIG_NEG_INT = -(BigInt(12345678) * BigInt(10 ** 9) + BigInt(987654321))
307+
const BIG_NEG_INT = -(
308+
BigInt(12_345_678) * BigInt(10 ** 9) +
309+
BigInt(987_654_321)
310+
)
308311

309312
test("readI64", () => {
310313
const bc = fromBytes(0x4f, 0x0b, 0x6e, 0x9d, 0xab, 0x23, 0xd4, 0xff)
@@ -495,7 +498,7 @@ test("writeU8", () => {
495498

496499
{
497500
const bc = fromBytes()
498-
const action = () => writeU8(bc, 0x100)
501+
const action = () => writeU8(bc, 0x1_00)
499502
if (DEV) {
500503
assert.throws(
501504
action,
@@ -511,7 +514,7 @@ test("writeU8", () => {
511514

512515
test("readU16", () => {
513516
const bc = fromBytes(0xfe, 0xca)
514-
assert.deepEqual(readU16(bc), 0xcafe)
517+
assert.deepEqual(readU16(bc), 0xca_fe)
515518
assert.throws(
516519
() => readU16(bc),
517520
{ name: "BareError", issue: "missing bytes", offset: 2 },
@@ -522,13 +525,13 @@ test("readU16", () => {
522525
test("writeU16", () => {
523526
{
524527
const bc = fromBytes()
525-
writeU16(bc, 0xcafe)
528+
writeU16(bc, 0xca_fe)
526529
assert.deepEqual(toBytes(bc), [0xfe, 0xca])
527530
}
528531

529532
{
530533
const bc = fromBytes()
531-
const action = () => writeU16(bc, 0x10000)
534+
const action = () => writeU16(bc, 0x1_00_00)
532535
if (DEV) {
533536
assert.throws(
534537
action,
@@ -544,7 +547,7 @@ test("writeU16", () => {
544547

545548
test("readU32", () => {
546549
const bc = fromBytes(0xef, 0xbe, 0xad, 0xde)
547-
assert.deepEqual(readU32(bc), 0xdeadbeef)
550+
assert.deepEqual(readU32(bc), 0xde_ad_be_ef)
548551
assert.throws(
549552
() => readU32(bc),
550553
{ name: "BareError", issue: "missing bytes", offset: 4 },
@@ -555,7 +558,7 @@ test("readU32", () => {
555558
test("writeU32", () => {
556559
{
557560
const bc = fromBytes()
558-
writeU32(bc, 0xdeadbeef)
561+
writeU32(bc, 0xde_ad_be_ef)
559562
assert.deepEqual(toBytes(bc), [0xef, 0xbe, 0xad, 0xde])
560563
}
561564

@@ -576,7 +579,7 @@ test("writeU32", () => {
576579
})
577580

578581
const CAFE_BABE_DEAD_BEEF =
579-
(BigInt(0xcafe_babe) << BigInt(32)) + BigInt(0xdead_beef)
582+
(BigInt(0xca_fe_ba_be) << BigInt(32)) + BigInt(0xde_ad_be_ef)
580583

581584
test("readU64", () => {
582585
const bc = fromBytes(0xef, 0xbe, 0xad, 0xde, 0xbe, 0xba, 0xfe, 0xca)
@@ -648,7 +651,7 @@ test("writeU64Safe", () => {
648651
{
649652
const bc = fromBytes()
650653
// biome-ignore lint/correctness/noPrecisionLoss: the lost of precision is intended
651-
const action = () => writeU64Safe(bc, 0xcafe_babe_dead_beef)
654+
const action = () => writeU64Safe(bc, 0xca_fe_ba_be_de_ad_be_ef)
652655
if (DEV) {
653656
assert.throws(
654657
action,

src/codec/fixed-primitive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ export function writeI64Safe(bc: ByteCursor, x: number): void {
143143
let highest32 = (x / /* 2**32 */ 0x1_00_00_00_00) | 0
144144
if (x < 0) {
145145
// get two's complement representation of the highest 21bits
146-
highest32 = ~(Math.abs(highest32) & /* 2**21-1 */ 0x1f_ffff) >>> 0
146+
highest32 = ~(Math.abs(highest32) & /* 2**21-1 */ 0x1f_ff_ff) >>> 0
147147
if (lowest32 === 0) {
148-
if (highest32 === 0x1f_ffff) {
148+
if (highest32 === 0x1f_ff_ff) {
149149
// maps -2**53 to Number.MIN_SAFE_INTEGER
150150
// this is useful when assertions are skipped
151151
lowest32 = 1
@@ -232,5 +232,5 @@ export function writeU64Safe(bc: ByteCursor, x: number): void {
232232
assert(isU64Safe(x), TOO_LARGE_NUMBER)
233233
}
234234
writeU32(bc, x >>> 0)
235-
writeU32(bc, (x / /* 2**32 */ 0x1_00_00_00_00) & /* 2**21-1 */ 0x1f_ffff)
235+
writeU32(bc, (x / /* 2**32 */ 0x1_00_00_00_00) & /* 2**21-1 */ 0x1f_ff_ff)
236236
}

src/codec/int.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export function writeIntSafe(bc: ByteCursor, x: number): void {
6666
}
6767
// keep only the remaining 53 - 6 = 47 bits
6868
// this is useful when assertions are skipped
69-
const low = zigZag & 0x7fff
70-
const high = ((zigZag / 0x8000) >>> 0) * 0x8000
71-
if (first7Bits === 0x7f && low === 0x7fff && high === 0xffff_ffff) {
69+
const low = zigZag & 0x7f_ff
70+
const high = ((zigZag / 0x80_00) >>> 0) * 0x80_00
71+
if (first7Bits === 0x7f && low === 0x7f_ff && high === 0xff_ff_ff_ff) {
7272
// maps -2**53 to Number.MIN_SAFE_INTEGER
7373
// this is useful when assertions are skipped
7474
first7Bits &= ~0b10

0 commit comments

Comments
 (0)