From 7630f12164c783555c91a183fbb140b685fe5782 Mon Sep 17 00:00:00 2001 From: o-az Date: Thu, 7 Nov 2024 20:57:19 -0800 Subject: [PATCH 1/2] chore: fmt and add pkg --- .gitattributes | 1 + app/src/lib/queries/balance/evm/multicall.ts | 2 +- biome.json | 1 + ceremony/src/lib/utils/utils.ts | 2 +- flake.nix | 5 +++-- site/src/lib/contentful/live-preview.ts | 12 +++++++----- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.gitattributes b/.gitattributes index 82fdc2ba57..88706d843d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -15,3 +15,4 @@ evm/contracts/proto/** linguist-generated *.lockb binary diff=lockb *.zip filter=lfs diff=lfs merge=lfs -text site/public/union-logo.zip filter=lfs diff=lfs merge=lfs -text +biome.json linguist-language=JSON-with-Comments diff --git a/app/src/lib/queries/balance/evm/multicall.ts b/app/src/lib/queries/balance/evm/multicall.ts index 963a631a46..40ef36e443 100644 --- a/app/src/lib/queries/balance/evm/multicall.ts +++ b/app/src/lib/queries/balance/evm/multicall.ts @@ -51,7 +51,7 @@ export async function erc20ReadMulticall({ (accumulator, { result }, index) => { if (index % functionNames.length === 0) accumulator.push({}) - const currentResult = accumulator[accumulator.length - 1] + const currentResult = accumulator.at(-1) const fn = functionNames[index % functionNames.length] currentResult[fn === "balanceOf" ? "balance" : fn] = result ?? (fn === "decimals" ? 0 : "") return accumulator diff --git a/biome.json b/biome.json index 124bed0a8f..5b3a07e6b9 100644 --- a/biome.json +++ b/biome.json @@ -224,6 +224,7 @@ "noSecrets": "off", "noProcessEnv": "off", "useStrictMode": "off", + "useExplicitType": "off", "noNestedTernary": "off", "noExportedImports": "off", "useImportRestrictions": "off", diff --git a/ceremony/src/lib/utils/utils.ts b/ceremony/src/lib/utils/utils.ts index d07b855fa1..d3cb6cc456 100644 --- a/ceremony/src/lib/utils/utils.ts +++ b/ceremony/src/lib/utils/utils.ts @@ -127,5 +127,5 @@ export function formatWaitTime(minutes: number) { return parts[0] } - return `${parts.slice(0, -1).join(", ")} and ${parts[parts.length - 1]}` + return `${parts.slice(0, -1).join(", ")} and ${parts.at(-1)}` } diff --git a/flake.nix b/flake.nix index b9ae27d828..702ce691be 100644 --- a/flake.nix +++ b/flake.nix @@ -494,10 +494,11 @@ yq ]) ++ (with jsPkgs; [ - bun # for running TypeScript files on the fly + bun + deno emmet-language-server - nodePackages.graphqurl nodePackages_latest.nodejs + nodePackages_latest.graphqurl nodePackages_latest.svelte-language-server nodePackages_latest."@astrojs/language-server" nodePackages_latest."@tailwindcss/language-server" diff --git a/site/src/lib/contentful/live-preview.ts b/site/src/lib/contentful/live-preview.ts index 3c67209f8c..26641ce019 100644 --- a/site/src/lib/contentful/live-preview.ts +++ b/site/src/lib/contentful/live-preview.ts @@ -49,11 +49,13 @@ export function setupLivePreview({ }) { const callback = (updatedData: any) => { const domElement = findElementByDataAttribute({ entryId, fieldId }) - if (domElement && updatedData.fields && updatedData.fields[fieldId]) { - // Check if the content is text - if (typeof updatedData.fields[fieldId] === "string") { - domElement.textContent = updatedData.fields[fieldId] - } + if ( + domElement && + updatedData.fields && + updatedData.fields[fieldId] && + typeof updatedData.fields[fieldId] === "string" + ) { + domElement.textContent = updatedData.fields[fieldId] } } const unsubscribe = ContentfulLivePreview.subscribe({ From 2369a86088aa6aa444bda79e24d11d91f8ff9b27 Mon Sep 17 00:00:00 2001 From: o-az Date: Fri, 8 Nov 2024 05:41:18 -0800 Subject: [PATCH 2/2] fix: spellcheck --- dictionary.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dictionary.txt b/dictionary.txt index c4124087b2..c7942e5077 100644 --- a/dictionary.txt +++ b/dictionary.txt @@ -508,6 +508,7 @@ deferredacktypes defi delegators dels +deno denoms denum depinject