Skip to content

Commit 2a16307

Browse files
committed
chore: update biome
1 parent 61061b6 commit 2a16307

35 files changed

+63
-65
lines changed

biome.json

+9-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.0.0/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json",
33
"files": {
44
"ignore": [
55
"node_modules",
66
"public",
77
"dist",
88
"contracts/cache",
99
"contracts/out",
10-
"contracts/generated",
10+
"contracts/generated.ts",
1111
"keys.json",
1212
"symbols/generated"
1313
]
@@ -16,20 +16,22 @@
1616
"enabled": true,
1717
"formatWithErrors": false,
1818
"indentStyle": "space",
19-
"indentSize": 2,
19+
"indentWidth": 2,
2020
"lineWidth": 80
2121
},
2222
"linter": {
2323
"enabled": true,
2424
"rules": {
2525
"recommended": true,
26-
"nursery": {
27-
"useExhaustiveDependencies": "error"
26+
"complexity": {
27+
"noForEach": "off"
2828
},
2929
"correctness": {
30-
"noUnusedVariables": "error"
30+
"noUnusedVariables": "error",
31+
"useExhaustiveDependencies": "off"
3132
},
3233
"performance": {
34+
"noAccumulatingSpread": "off",
3335
"noDelete": "off"
3436
},
3537
"style": {
@@ -39,6 +41,7 @@
3941
"suspicious": {
4042
"noArrayIndexKey": "off",
4143
"noAssignInExpressions": "off",
44+
"noConfusingVoidType": "off",
4245
"noExplicitAny": "off"
4346
}
4447
}

bun.lockb

806 Bytes
Binary file not shown.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"zustand": "^4.3.8"
7575
},
7676
"devDependencies": {
77-
"@biomejs/biome": "1.0.0",
77+
"@biomejs/biome": "1.6.4",
7878
"@samrum/vite-plugin-web-extension": "^5.1.0",
7979
"@types/chroma-js": "^2.4.0",
8080
"@types/chrome": "^0.0.266",

src/app.tsx

-3
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ function AccountsChangedEmitter() {
181181
const { sessions } = useSessionsStore()
182182

183183
const prevAccounts = useRef<AccountState['accounts']>()
184-
// rome-ignore lint/nursery/useExhaustiveDependencies:
185184
useEffect(() => {
186185
if (!account) {
187186
prevAccounts.current = []
@@ -212,7 +211,6 @@ function NetworkChangedEmitter() {
212211
const { sessions } = useSessionsStore()
213212

214213
const prevNetwork = useRef<NetworkState['network']>()
215-
// rome-ignore lint/nursery/useExhaustiveDependencies:
216214
useEffect(() => {
217215
if (!network.chainId) return
218216

@@ -241,7 +239,6 @@ function SyncJsonRpcAccounts() {
241239
const client = useClient()
242240
const { getAccounts, setJsonRpcAccounts } = useAccountStore()
243241

244-
// rome-ignore lint/nursery/useExhaustiveDependencies: <explanation>
245242
useEffect(() => {
246243
;(async () => {
247244
const addresses = await client.getAddresses()

src/components/Header.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ function RpcUrl() {
261261
status === 'pending'
262262
? 'surface/[email protected]'
263263
: listening
264-
? 'surface/green'
265-
: 'surface/red'
264+
? 'surface/green'
265+
: 'surface/red'
266266
}
267267
borderWidth="1px"
268268
borderRadius="round"
@@ -368,8 +368,8 @@ function MiningStatus() {
368368
? automining
369369
? 'Automine'
370370
: network.blockTime
371-
? `Interval: ${network.blockTime}s`
372-
: 'On Demand'
371+
? `Interval: ${network.blockTime}s`
372+
: 'On Demand'
373373
: ''}
374374
</Text>
375375
</HeaderItem>

src/components/abi/AbiParametersInputs.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type AbiFunction, type AbiParameter } from 'abitype'
1+
import type { AbiFunction, AbiParameter } from 'abitype'
22
import { useEffect, useMemo } from 'react'
33
import {
44
type RegisterOptions,

src/components/abi/DecodedAbiParameters.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import * as Accordion from '@radix-ui/react-accordion'
2-
import {
3-
type AbiParameter,
4-
type AbiParameterToPrimitiveType,
5-
type AbiParametersToPrimitiveTypes,
2+
import type {
3+
AbiParameter,
4+
AbiParameterToPrimitiveType,
5+
AbiParametersToPrimitiveTypes,
66
} from 'abitype'
7-
import React, { useEffect, useMemo, useState } from 'react'
7+
import type React from 'react'
8+
import { useEffect, useMemo, useState } from 'react'
89
import { type Hex, concat, decodeAbiParameters, stringify } from 'viem'
910

1011
import { Tooltip } from '~/components'

src/design-system/components/Box.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export const Box = forwardRef(
5252
) as [BackgroundColor, string]
5353
const applyColorScheme =
5454
(backgroundColor === 'accent' || backgroundColors[baseBackgroundColor]) &&
55-
(!opacity || parseFloat(opacity) > 0.5)
55+
(!opacity || Number.parseFloat(opacity) > 0.5)
5656

5757
const {
5858
scheme: accentColorScheme,

src/design-system/components/Button.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ export const buttonVariants = [
3636
'tint green',
3737
'tint red',
3838
] as const satisfies readonly `${ButtonKind} ${string}`[]
39-
export type ButtonVariant = typeof buttonVariants[number]
39+
export type ButtonVariant = (typeof buttonVariants)[number]

src/design-system/components/ButtonSymbol.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { UnionOmit } from '~/utils/types'
55
import { Tooltip } from '../../components'
66
import type { SymbolName } from '../tokens'
77
import { ButtonRoot, type ButtonRootProps } from './Button'
8-
import { type ButtonHeight, type ButtonVariant } from './Button.css'
8+
import type { ButtonHeight, ButtonVariant } from './Button.css'
99
import { widthForHeight } from './ButtonSymbol.css'
1010
import { SFSymbol } from './SFSymbol'
1111
import type { SFSymbolProps } from './SFSymbol'

src/design-system/components/ButtonText.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { forwardRef } from 'react'
33
import { Box } from './Box'
44
import type { BoxStyles } from './Box.css'
55
import { ButtonRoot, type ButtonRootProps } from './Button'
6-
import { type ButtonHeight, type ButtonVariant } from './Button.css'
6+
import type { ButtonHeight, ButtonVariant } from './Button.css'
77
import { Text, type TextProps } from './Text'
88

99
type ButtonTextProps = ButtonRootProps

src/design-system/components/Input.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type InputKind = 'solid'
1818
export const inputVariants = [
1919
'solid',
2020
] as const satisfies readonly `${InputKind}`[]
21-
export type InputVariant = typeof inputVariants[number]
21+
export type InputVariant = (typeof inputVariants)[number]
2222

2323
export const heightStyles = styleVariants(inputHeights, (height) => [
2424
{ height },

src/design-system/components/Link.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, { forwardRef, useContext } from 'react'
1+
import type React from 'react'
2+
import { forwardRef, useContext } from 'react'
23
import { Link as RouterLink } from 'react-router-dom'
34

45
import { Box } from './Box'

src/design-system/components/Select.css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export type SelectKind = 'solid'
1616
export const selectVariants = [
1717
'solid',
1818
] as const satisfies readonly `${SelectKind}`[]
19-
export type SelectVariant = typeof selectVariants[number]
19+
export type SelectVariant = (typeof selectVariants)[number]
2020

2121
export const heightStyles = styleVariants(selectHeights, (height) => [
2222
{ height },

src/design-system/components/Text.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export const TextTruncated = forwardRef<HTMLDivElement, TextTruncatedProps>(
204204
const letterWidth = fontAttributes[size].letterWidth
205205

206206
const width_ = width
207-
? width - parseInt(heightForSize[size].replace('px', ''))
207+
? width - Number.parseInt(heightForSize[size].replace('px', ''))
208208
: undefined
209209
return typeof width_ === 'number'
210210
? truncate(children || '', {
@@ -235,7 +235,7 @@ export const TextTruncated = forwardRef<HTMLDivElement, TextTruncatedProps>(
235235
<Box
236236
position="absolute"
237237
style={{
238-
right: -parseInt(heightForSize[size].replace('px', '')),
238+
right: -Number.parseInt(heightForSize[size].replace('px', '')),
239239
top: -3,
240240
width: heightForSize[size],
241241
}}

src/design-system/tokens.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ function defineType(fontAttributes: FontAttributes, inline: boolean) {
495495
const leading =
496496
typeof lineHeight === 'number'
497497
? lineHeight
498-
: (fontSize * parseInt(lineHeight)) / 100
498+
: (fontSize * Number.parseInt(lineHeight)) / 100
499499

500500
if (inline) return { fontSize, letterSpacing }
501501
return {
@@ -658,7 +658,7 @@ export const symbolNames = [
658658
'backward.fill',
659659
'arrow.counterclockwise',
660660
] as const
661-
export type SymbolName = typeof symbolNames[number]
661+
export type SymbolName = (typeof symbolNames)[number]
662662

663663
export const textAlignment = ['left', 'center', 'right'] as const
664-
export type TextAlignment = typeof textAlignment[number]
664+
export type TextAlignment = (typeof textAlignment)[number]

src/design-system/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { join } from 'path'
1+
import { join } from 'node:path'
22
import { defineConfig } from 'vite'
33

44
// https://vitejs.dev/config/

src/errors/base.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export class BaseError extends Error {
2626
args.cause instanceof BaseError
2727
? args.cause.details
2828
: args.cause?.message
29-
? args.cause.message
30-
: args.details!
29+
? args.cause.message
30+
: args.details!
3131

3232
this.message = [
3333
shortMessage || 'An error occurred.',

src/hooks/useAccounts.ts

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export function useAccounts() {
55
const { accounts, getAccounts } = useAccountStore()
66
const { network } = useNetworkStore()
77

8-
// rome-ignore lint/nursery/useExhaustiveDependencies:
98
return useMemo(
109
() => getAccounts({ rpcUrl: network.rpcUrl }),
1110
[accounts, network.rpcUrl],

src/hooks/useAutoloadAbi.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { loaders, whatsabi } from '@shazow/whatsabi'
22
import { queryOptions, useQuery } from '@tanstack/react-query'
3-
import { type Address, type Client } from 'viem'
3+
import type { Address, Client } from 'viem'
44
import { createQueryKey } from '~/react-query'
55
import { etherscanApiUrls } from '../constants/etherscan'
66
import { useClient } from './useClient'
@@ -22,8 +22,8 @@ export function useAutoloadAbiQueryOptions({
2222
const client = useClient()
2323
return queryOptions({
2424
enabled: enabled && Boolean(address),
25-
gcTime: Infinity,
26-
staleTime: Infinity,
25+
gcTime: Number.POSITIVE_INFINITY,
26+
staleTime: Number.POSITIVE_INFINITY,
2727
queryKey: autoloadAbiQueryKey([client.key, address!]),
2828
async queryFn() {
2929
if (!address) throw new Error('address is required')

src/hooks/useContracts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function useContractsQueryOptions({
2727
const client = useClient()
2828

2929
return queryOptions({
30-
staleTime: Infinity,
30+
staleTime: Number.POSITIVE_INFINITY,
3131
enabled: Boolean(
3232
enabled &&
3333
block?.number &&

src/hooks/useGetLogs.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ export function getLogsQueryOptions<
4242
enabled,
4343
gcTime:
4444
typeof fromBlock === 'bigint' && typeof toBlock === 'bigint'
45-
? Infinity
45+
? Number.POSITIVE_INFINITY
4646
: undefined,
4747
staleTime:
4848
typeof fromBlock === 'bigint' && typeof toBlock === 'bigint'
49-
? Infinity
49+
? Number.POSITIVE_INFINITY
5050
: undefined,
5151
queryKey: getLogsQueryKey([client.key, stringify(args)]),
5252
async queryFn() {

src/hooks/useLookupSignature.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { loaders } from '@shazow/whatsabi'
22
import { queryOptions, useQuery } from '@tanstack/react-query'
3-
import { type Client, type Hex } from 'viem'
3+
import type { Client, Hex } from 'viem'
44
import { createQueryKey } from '~/react-query'
55
import { useClient } from './useClient'
66

@@ -21,8 +21,8 @@ export function useLookupSignatureQueryOptions({
2121
const client = useClient()
2222
return queryOptions({
2323
enabled: enabled && Boolean(selector),
24-
gcTime: Infinity,
25-
staleTime: Infinity,
24+
gcTime: Number.POSITIVE_INFINITY,
25+
staleTime: Number.POSITIVE_INFINITY,
2626
queryKey: lookupSignatureQueryKey([client.key, selector!]),
2727
async queryFn() {
2828
if (!selector) throw new Error('selector is required')

src/hooks/usePendingBlock.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type InfiniteData, useQuery } from '@tanstack/react-query'
2-
import { type Block, type Client, type Transaction } from 'viem'
2+
import type { Block, Client, Transaction } from 'viem'
33

44
import {
55
createQueryKey,

src/hooks/usePrevious.ts

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useEffect, useRef } from 'react'
33
export function usePrevious<T>(newValue: T) {
44
const previousRef = useRef<T>()
55

6-
// rome-ignore lint/nursery/useExhaustiveDependencies:
76
useEffect(() => {
87
previousRef.current = newValue
98
})

src/hooks/useSnapshot.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function useSnapshotQueryOptions({
2121
}: UseSnapshotParameters) {
2222
const client = useClient()
2323
return queryOptions({
24-
gcTime: Infinity,
24+
gcTime: Number.POSITIVE_INFINITY,
2525
staleTime: 0,
2626
enabled: Boolean(enabled && blockNumber),
2727
queryKey: getSnapshotQueryKey([client.key, (blockNumber || '').toString()]),

src/messengers/transports/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export type Transport<
4040
},
4141
) => Promise<TSchema extends TransportSchema ? TSchema[TTopic][1] : unknown>
4242
/** Replies to `send`. */
43-
reply: <TTopic extends keyof TSchema,>(
43+
reply: <TTopic extends keyof TSchema>(
4444
/** A scoped topic that was sent from `send`. */
4545
topic: TTopic,
4646
callback: CallbackFunction<

src/messengers/transports/window.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export const createWindowTransport = <TConnection extends string>(
4141
const sender = event.source
4242
if (sender !== window) return
4343

44-
let error
45-
let response
44+
let error: unknown
45+
let response: unknown
4646
try {
4747
response = await callback(event.data.payload, {
4848
connection: event.data.connection,

src/screens/_layout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export default function Layout() {
2424
const showHeader = onboarded
2525

2626
const isNetworkOffline = Boolean(network.rpcUrl && onboarded && !online)
27-
// rome-ignore lint/nursery/useExhaustiveDependencies:
2827
useEffect(() => {
2928
contentMessenger.reply('pushRoute', async (route) => {
3029
navigate(route)

src/screens/account-details.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useNavigate, useParams, useSearchParams } from 'react-router-dom'
55
import { toast } from 'sonner'
66
import {
77
type Address,
8-
BaseError,
8+
type BaseError,
99
formatUnits,
1010
isAddress,
1111
parseUnits,

src/screens/contract-details.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export default function ContractDetails() {
4848
.filter((abiItem) => abiItem.type === 'function')
4949
.map((abiItem) => ({
5050
...abiItem,
51-
inputs: (abiItem as {} as AbiFunction).inputs || [],
52-
outputs: (abiItem as {} as AbiFunction).outputs || [],
53-
})) as {} as AbiFunction[]
51+
inputs: (abiItem as unknown as AbiFunction).inputs || [],
52+
outputs: (abiItem as unknown as AbiFunction).outputs || [],
53+
})) as unknown as AbiFunction[]
5454
}, [abi])
5555

5656
const hasStateMutability = !abiFunctions?.some(
@@ -74,7 +74,7 @@ export default function ContractDetails() {
7474
(abiItem.stateMutability === 'nonpayable' ||
7575
abiItem.stateMutability === 'payable'),
7676
)
77-
return [read as {} as AbiFunction[], write as {} as AbiFunction[]]
77+
return [read as unknown as AbiFunction[], write as unknown as AbiFunction[]]
7878
}, [abiFunctions, hasStateMutability])
7979

8080
////////////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)