diff --git a/website/src/components/ui/use-toast.ts b/website/src/components/ui/use-toast.ts
index e43f67574..57e33d947 100644
--- a/website/src/components/ui/use-toast.ts
+++ b/website/src/components/ui/use-toast.ts
@@ -3,7 +3,7 @@ import * as React from 'react';
import type { ToastActionElement, ToastProps } from '@/components/ui/toast';
const TOAST_LIMIT = 1;
-const TOAST_REMOVE_DELAY = 1000000;
+const TOAST_REMOVE_DELAY = 1_000_000;
type ToasterToast = ToastProps & {
id: string;
@@ -12,12 +12,12 @@ type ToasterToast = ToastProps & {
action?: ToastActionElement;
};
-const actionTypes = {
- ADD_TOAST: 'ADD_TOAST',
- UPDATE_TOAST: 'UPDATE_TOAST',
- DISMISS_TOAST: 'DISMISS_TOAST',
- REMOVE_TOAST: 'REMOVE_TOAST',
-} as const;
+type ActionType = {
+ ADD_TOAST: 'ADD_TOAST';
+ UPDATE_TOAST: 'UPDATE_TOAST';
+ DISMISS_TOAST: 'DISMISS_TOAST';
+ REMOVE_TOAST: 'REMOVE_TOAST';
+};
let count = 0;
@@ -26,8 +26,6 @@ function genId() {
return count.toString();
}
-type ActionType = typeof actionTypes;
-
type Action =
| {
type: ActionType['ADD_TOAST'];
@@ -61,7 +59,7 @@ const addToRemoveQueue = (toastId: string) => {
toastTimeouts.delete(toastId);
dispatch({
type: 'REMOVE_TOAST',
- toastId: toastId,
+ toastId,
});
}, TOAST_REMOVE_DELAY);
@@ -90,9 +88,9 @@ export const reducer = (state: State, action: Action): State => {
if (toastId) {
addToRemoveQueue(toastId);
} else {
- state.toasts.forEach(toast => {
+ for (const toast of state.toasts) {
addToRemoveQueue(toast.id);
- });
+ }
}
return {
@@ -127,9 +125,9 @@ let memoryState: State = { toasts: [] };
function dispatch(action: Action) {
memoryState = reducer(memoryState, action);
- listeners.forEach(listener => {
+ for (const listener of listeners) {
listener(memoryState);
- });
+ }
}
type Toast = Omit;
@@ -157,7 +155,7 @@ function toast({ ...props }: Toast) {
});
return {
- id: id,
+ id,
dismiss,
update,
};
diff --git a/website/src/routes/publish.lazy.tsx b/website/src/routes/publish.lazy.tsx
index a8c9b2aa6..b297bd6b0 100644
--- a/website/src/routes/publish.lazy.tsx
+++ b/website/src/routes/publish.lazy.tsx
@@ -6,8 +6,8 @@ import { Address } from 'viem';
import { useAccount, useSwitchChain, useWriteContract } from 'wagmi';
import yaml from 'yaml';
import { z } from 'zod';
-import { SubgraphImageDropZone } from '@/components/Dropzone';
-import { Editor } from '@/components/Editor';
+import { SubgraphImageDropZone } from '@/components/dropzone';
+import { Editor } from '@/components/editor';
import { Button } from '@/components/ui/button';
import {
Form,
@@ -38,18 +38,18 @@ import { ipfsHexHash } from '@/lib/utils';
import { zodResolver } from '@hookform/resolvers/zod';
import { useQuery } from '@tanstack/react-query';
import { createLazyFileRoute } from '@tanstack/react-router';
-import { L2GNSABI } from '../abis/L2GNS';
+import { L2GNSABI } from '../abis/l2gns';
import addresses from '../addresses.json';
const SUPPORTED_CHAIN = {
'arbitrum-one': {
- chainId: 42161,
- contracts: addresses[42161],
+ chainId: 42_161,
+ contracts: addresses[42_161],
subgraph: NETWORK_SUBGRAPH_MAINNET,
},
'arbitrum-sepolia': {
- chainId: 421614,
- contracts: addresses[421614],
+ chainId: 421_614,
+ contracts: addresses[421_614],
subgraph: NETWORK_SUBGRAPH_SEPOLIA,
},
} as const;
@@ -60,9 +60,9 @@ const getChainInfo = (chain: keyof typeof SUPPORTED_CHAIN) => {
const publishToCopy = (chain: ReturnType['chainId']) => {
switch (chain) {
- case 42161:
+ case 42_161:
return 'The Graph Network';
- case 421614:
+ case 421_614:
return 'The Graph Testnet (not meant for production workload)';
}
};
@@ -390,16 +390,17 @@ function DeploySubgraph({
toast({
description: 'You are all set! You can go back to the CLI and close this window',
});
- } catch (err) {
+ } catch (_) {
const e = contractError;
- if (e?.name === 'ContractFunctionExecutionError') {
- if (e.cause.name === 'ContractFunctionRevertedError') {
- toast({
- description: e.cause.message,
- variant: 'destructive',
- });
- return;
- }
+ if (
+ e?.name === 'ContractFunctionExecutionError' &&
+ e.cause.name === 'ContractFunctionRevertedError'
+ ) {
+ toast({
+ description: e.cause.message,
+ variant: 'destructive',
+ });
+ return;
}
toast({
diff --git a/website/tailwind.config.js b/website/tailwind.config.js
index 05a774823..97520eb35 100644
--- a/website/tailwind.config.js
+++ b/website/tailwind.config.js
@@ -1,6 +1,8 @@
-/* eslint-disable no-undef */
/** @type {import('tailwindcss').Config} */
-module.exports = {
+
+import animate from 'tailwindcss-animate';
+
+export default {
darkMode: ['class'],
content: [
'./pages/**/*.{ts,tsx}',
@@ -74,5 +76,5 @@ module.exports = {
},
},
},
- plugins: [require('tailwindcss-animate')],
+ plugins: [animate],
};
diff --git a/website/vite.config.ts b/website/vite.config.ts
index e2ea07f00..692a8fd20 100644
--- a/website/vite.config.ts
+++ b/website/vite.config.ts
@@ -1,4 +1,4 @@
-import path from 'path';
+import path from 'node:path';
import { defineConfig } from 'vite';
import { nodePolyfills } from 'vite-plugin-node-polyfills';
import { TanStackRouterVite } from '@tanstack/router-vite-plugin';