diff --git a/e2e/packages/sync-test/data/callPageFunction.ts b/e2e/packages/sync-test/data/callPageFunction.ts index 89a9c395a4..9602f96050 100644 --- a/e2e/packages/sync-test/data/callPageFunction.ts +++ b/e2e/packages/sync-test/data/callPageFunction.ts @@ -12,9 +12,8 @@ export async function callPageFunction( args: unknown[], ): Promise | undefined> { const context = [functionName, args, serialize.toString(), deserialize.toString()] as const; - const serializedValue = await page.evaluate(async ([functionName, args, serializeString, deserializeString]) => { + const serializedValue = await page.evaluate(async ([functionName, args, serializeString]) => { const _serialize = deserializeFunction(serializeString); - const _deserialize = deserializeFunction(deserializeString); const value = await (window as any)[functionName](...args); const serializedValue = value ? _serialize(value) : undefined; return serializedValue; diff --git a/examples/minimal/packages/client-phaser/src/ui/Wrapper.tsx b/examples/minimal/packages/client-phaser/src/ui/Wrapper.tsx index 5cc66f3d28..3de7eb15de 100644 --- a/examples/minimal/packages/client-phaser/src/ui/Wrapper.tsx +++ b/examples/minimal/packages/client-phaser/src/ui/Wrapper.tsx @@ -1,4 +1,3 @@ -import React from "react"; import styled from "styled-components"; export const Wrapper = styled.div` diff --git a/examples/minimal/packages/client-phaser/src/ui/hooks/useNetworkLayer.tsx b/examples/minimal/packages/client-phaser/src/ui/hooks/useNetworkLayer.tsx index 139c457234..e2e13ab01a 100644 --- a/examples/minimal/packages/client-phaser/src/ui/hooks/useNetworkLayer.tsx +++ b/examples/minimal/packages/client-phaser/src/ui/hooks/useNetworkLayer.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useMemo } from "react"; +import { useEffect, useMemo } from "react"; import { createNetworkLayer } from "../../layers/network/createNetworkLayer"; import { usePromiseValue } from "./usePromiseValue"; diff --git a/examples/minimal/packages/client-react/src/mud/setupNetwork.ts b/examples/minimal/packages/client-react/src/mud/setupNetwork.ts index 9a27f78768..c26d4fe250 100644 --- a/examples/minimal/packages/client-react/src/mud/setupNetwork.ts +++ b/examples/minimal/packages/client-react/src/mud/setupNetwork.ts @@ -1,5 +1,4 @@ -import { createPublicClient, fallback, webSocket, http, createWalletClient, Hex, parseEther, ClientConfig } from "viem"; -import { createFaucetService } from "@latticexyz/services/faucet"; +import { createPublicClient, fallback, webSocket, http, createWalletClient, Hex, ClientConfig } from "viem"; import { encodeEntity, syncToRecs } from "@latticexyz/store-sync/recs"; import { getNetworkConfig } from "./getNetworkConfig"; import { world } from "./world"; diff --git a/examples/multiple-accounts/packages/client/src/App.tsx b/examples/multiple-accounts/packages/client/src/App.tsx index d4ad3d21bf..b2c44d0e33 100644 --- a/examples/multiple-accounts/packages/client/src/App.tsx +++ b/examples/multiple-accounts/packages/client/src/App.tsx @@ -38,7 +38,7 @@ const makeWorldContract = () => { }; // Create five world contracts -const worldContracts = [1, 2, 3, 4, 5].map((x) => makeWorldContract()); +const worldContracts = [1, 2, 3, 4, 5].map(() => makeWorldContract()); export const App = () => { const { @@ -61,7 +61,7 @@ export const App = () => { // Call newCall() on LastCall:LastCallSystem. const newCall = async (worldContract) => { - const tx = await worldContract.write.LastCall_LastCallSystem_newCall(); + await worldContract.write.LastCall_LastCallSystem_newCall(); }; return ( diff --git a/examples/multiple-accounts/packages/client/src/mud/createSystemCalls.ts b/examples/multiple-accounts/packages/client/src/mud/createSystemCalls.ts index 0b8c753a67..d4a9bde221 100644 --- a/examples/multiple-accounts/packages/client/src/mud/createSystemCalls.ts +++ b/examples/multiple-accounts/packages/client/src/mud/createSystemCalls.ts @@ -3,11 +3,8 @@ * for changes in the World state (using the System contracts). */ -import { Hex } from "viem"; -import { SetupNetworkResult } from "./setupNetwork"; - export type SystemCalls = ReturnType; -export function createSystemCalls({ tables, useStore, worldContract, waitForTransaction }: SetupNetworkResult) { +export function createSystemCalls() { return {}; } diff --git a/examples/multiple-accounts/packages/client/src/mud/setup.ts b/examples/multiple-accounts/packages/client/src/mud/setup.ts index 6d07134612..4ae0c868d6 100644 --- a/examples/multiple-accounts/packages/client/src/mud/setup.ts +++ b/examples/multiple-accounts/packages/client/src/mud/setup.ts @@ -9,7 +9,7 @@ export type SetupResult = Awaited>; export async function setup() { const network = await setupNetwork(); - const systemCalls = createSystemCalls(network); + const systemCalls = createSystemCalls(); return { network, diff --git a/packages/abi-ts/src/abi-ts.ts b/packages/abi-ts/src/abi-ts.ts index a6093d52ec..9ca7f03174 100755 --- a/packages/abi-ts/src/abi-ts.ts +++ b/packages/abi-ts/src/abi-ts.ts @@ -17,7 +17,7 @@ yargs(hideBin(process.argv)) // Enable strict mode. .strict() // Custom error handler - .fail((msg, err) => { + .fail((msg) => { console.error(chalk.red(msg)); if (msg.includes("Missing required argument")) { console.log( diff --git a/packages/cli/src/deploy/getSystems.ts b/packages/cli/src/deploy/getSystems.ts index b3cfa98eb6..c94d4b5824 100644 --- a/packages/cli/src/deploy/getSystems.ts +++ b/packages/cli/src/deploy/getSystems.ts @@ -1,5 +1,5 @@ -import { DeployedSystem, System, WorldDeploy, worldTables } from "./common"; -import { Address, Client } from "viem"; +import { DeployedSystem, WorldDeploy, worldTables } from "./common"; +import { Client } from "viem"; import { getResourceIds } from "./getResourceIds"; import { hexToResource, resourceToLabel } from "@latticexyz/common"; import { getTableValue } from "./getTableValue"; diff --git a/packages/cli/src/mudPackages.ts b/packages/cli/src/mudPackages.ts index 8392dac891..6cd6f9bf0b 100644 --- a/packages/cli/src/mudPackages.ts +++ b/packages/cli/src/mudPackages.ts @@ -13,7 +13,7 @@ function parseEnv(): z.infer { }); } catch (error) { if (error instanceof ZodError) { - const { _errors, ...invalidEnvVars } = error.format(); + const { ...invalidEnvVars } = error.format(); console.error(`\nMissing or invalid environment variables:\n\n ${Object.keys(invalidEnvVars).join("\n ")}\n`); process.exit(1); } diff --git a/packages/dev-tools/src/recs/ComponentDataTable.tsx b/packages/dev-tools/src/recs/ComponentDataTable.tsx index 6dce6eb87f..ccf3510a26 100644 --- a/packages/dev-tools/src/recs/ComponentDataTable.tsx +++ b/packages/dev-tools/src/recs/ComponentDataTable.tsx @@ -1,6 +1,5 @@ import { useEntityQuery } from "@latticexyz/react"; import { Component, Has, getComponentValueStrict, Type } from "@latticexyz/recs"; -import { decodeEntity } from "@latticexyz/store-sync/recs"; import { serialize } from "../serialize"; // TODO: use react-table or similar for better perf with lots of logs diff --git a/packages/dev-tools/src/zustand/TableDataTable.tsx b/packages/dev-tools/src/zustand/TableDataTable.tsx index 2bd95d2dd1..c6e147951f 100644 --- a/packages/dev-tools/src/zustand/TableDataTable.tsx +++ b/packages/dev-tools/src/zustand/TableDataTable.tsx @@ -1,7 +1,5 @@ import { Table } from "@latticexyz/store"; import { useRecords } from "./useRecords"; -import { isHex } from "viem"; -import { TruncatedHex } from "../TruncatedHex"; import { FieldValue } from "./FieldValue"; // TODO: use react-table or similar for better perf with lots of logs diff --git a/packages/dev-tools/src/zustand/useRecords.ts b/packages/dev-tools/src/zustand/useRecords.ts index 3e549b0d32..7656bd55b3 100644 --- a/packages/dev-tools/src/zustand/useRecords.ts +++ b/packages/dev-tools/src/zustand/useRecords.ts @@ -12,7 +12,7 @@ export function useRecords(table: table): TableRecord
{ - return useStore.subscribe((state) => { + return useStore.subscribe(() => { const nextRecords = useStore.getState().getRecords(table); if (nextRecords !== records) { setRecords(nextRecords); diff --git a/packages/faucet/bin/parseEnv.ts b/packages/faucet/bin/parseEnv.ts index 7d17e6da78..00798c5a69 100644 --- a/packages/faucet/bin/parseEnv.ts +++ b/packages/faucet/bin/parseEnv.ts @@ -20,7 +20,7 @@ export function parseEnv( return envSchema.parse(process.env); } catch (error) { if (error instanceof ZodError) { - const { _errors, ...invalidEnvVars } = error.format(); + const { ...invalidEnvVars } = error.format(); console.error(`\nMissing or invalid environment variables:\n\n ${Object.keys(invalidEnvVars).join("\n ")}\n`); process.exit(1); } diff --git a/packages/gas-report/ts/gas-report.ts b/packages/gas-report/ts/gas-report.ts index 2391c2f101..a7e749ef39 100755 --- a/packages/gas-report/ts/gas-report.ts +++ b/packages/gas-report/ts/gas-report.ts @@ -21,7 +21,7 @@ yargs(hideBin(process.argv)) // Enable strict mode. .strict() // Custom error handler - .fail((msg, err) => { + .fail((msg) => { console.error(chalk.red(msg)); if (msg.includes("Missing required argument")) { console.log( diff --git a/packages/recs/src/Query.ts b/packages/recs/src/Query.ts index 2ebce7fa81..6210c9973a 100644 --- a/packages/recs/src/Query.ts +++ b/packages/recs/src/Query.ts @@ -1,6 +1,6 @@ import { filterNullish } from "@latticexyz/utils"; import { observable, ObservableSet } from "mobx"; -import { concat, concatMap, filter, from, map, merge, Observable, of, share, Subject } from "rxjs"; +import { concat, concatMap, filter, from, map, merge, Observable, of, share } from "rxjs"; import { componentValueEquals, getComponentEntities, @@ -15,7 +15,6 @@ import { ComponentValue, Entity, EntityQueryFragment, - EntitySymbol, HasQueryFragment, HasValueQueryFragment, NotQueryFragment, diff --git a/packages/schema-type/src/typescript/dynamicAbiTypes.ts b/packages/schema-type/src/typescript/dynamicAbiTypes.ts index 8c4549c2f2..3563b476a3 100644 --- a/packages/schema-type/src/typescript/dynamicAbiTypes.ts +++ b/packages/schema-type/src/typescript/dynamicAbiTypes.ts @@ -1,7 +1,6 @@ import { Hex } from "viem"; -import { DynamicAbiType, SchemaAbiType, dynamicAbiTypes } from "./schemaAbiTypes"; +import { DynamicAbiType, dynamicAbiTypes } from "./schemaAbiTypes"; import { LiteralToBroad } from "./utils"; -import { isArrayAbiType } from "./arrayAbiTypes"; // Variable-length ABI types, where their lengths are encoded by a PackedCounter within the record diff --git a/packages/store-indexer/bin/parseEnv.ts b/packages/store-indexer/bin/parseEnv.ts index 5a001a61a3..637eaa47d7 100644 --- a/packages/store-indexer/bin/parseEnv.ts +++ b/packages/store-indexer/bin/parseEnv.ts @@ -31,7 +31,7 @@ export function parseEnv(envSchema: TSchema): z.infe return envSchema.parse(process.env); } catch (error) { if (error instanceof ZodError) { - const { _errors, ...invalidEnvVars } = error.format(); + const { ...invalidEnvVars } = error.format(); console.error(`\nMissing or invalid environment variables:\n\n ${Object.keys(invalidEnvVars).join("\n ")}\n`); process.exit(1); } diff --git a/packages/store-sync/src/postgres-decoded/buildTable.ts b/packages/store-sync/src/postgres-decoded/buildTable.ts index 56797a8438..a633e3c80a 100644 --- a/packages/store-sync/src/postgres-decoded/buildTable.ts +++ b/packages/store-sync/src/postgres-decoded/buildTable.ts @@ -1,5 +1,5 @@ import { PgColumnBuilderBase, PgTableWithColumns, pgSchema } from "drizzle-orm/pg-core"; -import { Address, getAddress } from "viem"; +import { Address } from "viem"; import { snakeCase } from "change-case"; import { KeySchema, ValueSchema } from "@latticexyz/protocol-parser"; import { asBigInt, asHex } from "../postgres/columnTypes"; diff --git a/packages/store-sync/src/postgres-decoded/createStorageAdapter.test.ts b/packages/store-sync/src/postgres-decoded/createStorageAdapter.test.ts index 6158b9368c..94c8c6d12b 100644 --- a/packages/store-sync/src/postgres-decoded/createStorageAdapter.test.ts +++ b/packages/store-sync/src/postgres-decoded/createStorageAdapter.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it } from "vitest"; -import { DefaultLogger, eq } from "drizzle-orm"; +import { eq } from "drizzle-orm"; import { drizzle } from "drizzle-orm/postgres-js"; import postgres from "postgres"; import { Hex, RpcLog, createPublicClient, decodeEventLog, formatLog, http } from "viem"; @@ -21,7 +21,7 @@ const blocks = groupLogsByBlockNumber( topics: log.topics as [Hex, ...Hex[]], strict: true, }); - return formatLog(log as any as RpcLog, { args, eventName: eventName as string }) as StoreEventsLog; + return formatLog(log as RpcLog, { args, eventName: eventName as string }) as StoreEventsLog; }), ); diff --git a/packages/store-sync/src/postgres/createStorageAdapter.test.ts b/packages/store-sync/src/postgres/createStorageAdapter.test.ts index 84d5b09e85..63a542a113 100644 --- a/packages/store-sync/src/postgres/createStorageAdapter.test.ts +++ b/packages/store-sync/src/postgres/createStorageAdapter.test.ts @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, it } from "vitest"; -import { DefaultLogger, eq } from "drizzle-orm"; +import { eq } from "drizzle-orm"; import { drizzle } from "drizzle-orm/postgres-js"; import postgres from "postgres"; import { Hex, RpcLog, createPublicClient, decodeEventLog, formatLog, http } from "viem"; diff --git a/packages/store-sync/src/zustand/createStorageAdapter.ts b/packages/store-sync/src/zustand/createStorageAdapter.ts index 8a649c0216..cfedcbd1b8 100644 --- a/packages/store-sync/src/zustand/createStorageAdapter.ts +++ b/packages/store-sync/src/zustand/createStorageAdapter.ts @@ -17,7 +17,7 @@ export type CreateStorageAdapterOptions = { export function createStorageAdapter({ store, }: CreateStorageAdapterOptions): StorageAdapter { - return async function zustandStorageAdapter({ blockNumber, logs }) { + return async function zustandStorageAdapter({ logs }) { // TODO: clean this up so that we do one store write per block // record id => is deleted diff --git a/templates/phaser/packages/client/src/ui/hooks/usePhaserLayer.tsx b/templates/phaser/packages/client/src/ui/hooks/usePhaserLayer.tsx index 2d428b0c24..223d342947 100644 --- a/templates/phaser/packages/client/src/ui/hooks/usePhaserLayer.tsx +++ b/templates/phaser/packages/client/src/ui/hooks/usePhaserLayer.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import useResizeObserver, { ResizeHandler } from "use-resize-observer"; import { throttle } from "lodash"; import { createPhaserLayer } from "../../layers/phaser/createPhaserLayer";