From 4d53dbd0822116d33a0d8139272ff66ecf7676b3 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Tue, 14 Jan 2025 00:09:16 +0100 Subject: [PATCH] Upgrade prettier and re-format codebase --- components/ChainConnect/ChainItem.tsx | 4 ++-- components/ChainConnect/CustomChainForm.tsx | 4 +++- components/ChainConnect/DialogButton.tsx | 4 ++-- components/dataViews/AccountView/index.tsx | 4 ++-- components/dataViews/MultisigView/index.tsx | 2 +- .../OldCreateTxForm/MsgForm/MsgExecuteContractForm.tsx | 2 +- .../MsgForm/MsgInstantiateContract2Form.tsx | 2 +- .../MsgForm/MsgInstantiateContractForm.tsx | 2 +- .../OldCreateTxForm/MsgForm/MsgMigrateContractForm.tsx | 2 +- lib/request.ts | 2 +- package-lock.json | 9 +++++---- package.json | 4 ++-- 12 files changed, 22 insertions(+), 19 deletions(-) diff --git a/components/ChainConnect/ChainItem.tsx b/components/ChainConnect/ChainItem.tsx index a8bf14ec..60494299 100644 --- a/components/ChainConnect/ChainItem.tsx +++ b/components/ChainConnect/ChainItem.tsx @@ -29,7 +29,7 @@ export default function ChainItem({ chain, hoverCardElementBoundary }: ChainItem } } className={cn( - "group relative inline-flex cursor-pointer items-center justify-center gap-2 rounded-full border-2 border-white p-2.5 text-sm font-medium text-white focus:outline-none focus:ring-4 focus:ring-red-100 aria-selected:text-gray-900", + "group relative inline-flex cursor-pointer items-center justify-center gap-2 rounded-full border-2 border-white p-2.5 text-sm font-medium text-white focus:outline-none focus:ring-4 focus:ring-red-100 aria-selected:text-gray-900", connectedChain.registryName === chain.registryName ? "cursor-not-allowed border-green-600 bg-green-300 text-green-900 aria-selected:bg-green-300" : "transparent cursor-pointer border-white", @@ -62,7 +62,7 @@ export default function ChainItem({ chain, hoverCardElementBoundary }: ChainItem diff --git a/components/ChainConnect/CustomChainForm.tsx b/components/ChainConnect/CustomChainForm.tsx index 84582726..f0ea9ae5 100644 --- a/components/ChainConnect/CustomChainForm.tsx +++ b/components/ChainConnect/CustomChainForm.tsx @@ -266,7 +266,9 @@ export default function CustomChainForm() { { - field.onChange("text" in newMsgContent ? newMsgContent.text ?? "{}" : "{}"); + field.onChange( + "text" in newMsgContent ? (newMsgContent.text ?? "{}") : "{}", + ); }} /> diff --git a/components/ChainConnect/DialogButton.tsx b/components/ChainConnect/DialogButton.tsx index 7b2fb3ca..52a71369 100644 --- a/components/ChainConnect/DialogButton.tsx +++ b/components/ChainConnect/DialogButton.tsx @@ -30,12 +30,12 @@ export default function DialogButton() { return showChainSelect ? ( -
+
) : ( -
+
); diff --git a/components/dataViews/AccountView/index.tsx b/components/dataViews/AccountView/index.tsx index 67290614..bf0bfdc0 100644 --- a/components/dataViews/AccountView/index.tsx +++ b/components/dataViews/AccountView/index.tsx @@ -57,7 +57,7 @@ export default function AccountView() { copy(walletInfo.address); toast(`Copied address to clipboard`, { description: walletInfo.address }); }} - className=" flex items-center space-x-4 rounded-md border p-4 transition-colors hover:cursor-pointer hover:bg-muted/50" + className="flex items-center space-x-4 rounded-md border p-4 transition-colors hover:cursor-pointer hover:bg-muted/50" >
@@ -70,7 +70,7 @@ export default function AccountView() { copy(walletInfo.pubKey); toast(`Copied public key to clipboard`, { description: walletInfo.pubKey }); }} - className=" flex items-center space-x-4 rounded-md border p-4 transition-colors hover:cursor-pointer hover:bg-muted/50" + className="flex items-center space-x-4 rounded-md border p-4 transition-colors hover:cursor-pointer hover:bg-muted/50" >
diff --git a/components/dataViews/MultisigView/index.tsx b/components/dataViews/MultisigView/index.tsx index 7434a746..fdecccd0 100644 --- a/components/dataViews/MultisigView/index.tsx +++ b/components/dataViews/MultisigView/index.tsx @@ -92,7 +92,7 @@ export default function MultisigView() { copy(multisigAddress); toast(`Copied address to clipboard`, { description: multisigAddress }); }} - className=" flex items-center space-x-4 rounded-md border p-4 transition-colors hover:cursor-pointer hover:bg-muted/50" + className="flex items-center space-x-4 rounded-md border p-4 transition-colors hover:cursor-pointer hover:bg-muted/50" >
diff --git a/components/forms/OldCreateTxForm/MsgForm/MsgExecuteContractForm.tsx b/components/forms/OldCreateTxForm/MsgForm/MsgExecuteContractForm.tsx index db6b434b..f55497f9 100644 --- a/components/forms/OldCreateTxForm/MsgForm/MsgExecuteContractForm.tsx +++ b/components/forms/OldCreateTxForm/MsgForm/MsgExecuteContractForm.tsx @@ -174,7 +174,7 @@ const MsgExecuteContractForm = ({ label="Msg JSON" content={{ text: msgContent }} onChange={(newMsgContent, _, { contentErrors }) => { - setMsgContent("text" in newMsgContent ? newMsgContent.text ?? "{}" : "{}"); + setMsgContent("text" in newMsgContent ? (newMsgContent.text ?? "{}") : "{}"); jsonError.current = !!contentErrors; }} /> diff --git a/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx b/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx index 858b0158..7156e63f 100644 --- a/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx +++ b/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContract2Form.tsx @@ -252,7 +252,7 @@ const MsgInstantiateContract2Form = ({ label="Msg JSON" content={{ text: msgContent }} onChange={(newMsgContent, _, { contentErrors }) => { - setMsgContent("text" in newMsgContent ? newMsgContent.text ?? "{}" : "{}"); + setMsgContent("text" in newMsgContent ? (newMsgContent.text ?? "{}") : "{}"); jsonError.current = !!contentErrors; }} /> diff --git a/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContractForm.tsx b/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContractForm.tsx index 186dd8f5..916e07a7 100644 --- a/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContractForm.tsx +++ b/components/forms/OldCreateTxForm/MsgForm/MsgInstantiateContractForm.tsx @@ -215,7 +215,7 @@ const MsgInstantiateContractForm = ({ label="Msg JSON" content={{ text: msgContent }} onChange={(newMsgContent, _, { contentErrors }) => { - setMsgContent("text" in newMsgContent ? newMsgContent.text ?? "{}" : "{}"); + setMsgContent("text" in newMsgContent ? (newMsgContent.text ?? "{}") : "{}"); jsonError.current = !!contentErrors; }} /> diff --git a/components/forms/OldCreateTxForm/MsgForm/MsgMigrateContractForm.tsx b/components/forms/OldCreateTxForm/MsgForm/MsgMigrateContractForm.tsx index 2d177b58..8b7b743a 100644 --- a/components/forms/OldCreateTxForm/MsgForm/MsgMigrateContractForm.tsx +++ b/components/forms/OldCreateTxForm/MsgForm/MsgMigrateContractForm.tsx @@ -120,7 +120,7 @@ const MsgMigrateContractForm = ({ label="Msg JSON" content={{ text: msgContent }} onChange={(newMsgContent, _, { contentErrors }) => { - setMsgContent("text" in newMsgContent ? newMsgContent.text ?? "{}" : "{}"); + setMsgContent("text" in newMsgContent ? (newMsgContent.text ?? "{}") : "{}"); jsonError.current = !!contentErrors; }} /> diff --git a/lib/request.ts b/lib/request.ts index 263d27a3..15c1812b 100644 --- a/lib/request.ts +++ b/lib/request.ts @@ -5,7 +5,7 @@ export const requestJson = async ( { method, headers, body, ...restConfig }: RequestConfig = {}, ) => { const config: RequestInit = { - method: method ?? body ? "POST" : "GET", + method: (method ?? body) ? "POST" : "GET", headers: body ? { "Content-Type": "application/json", ...headers } : headers, body: body ? JSON.stringify(body) : null, ...restConfig, diff --git a/package-lock.json b/package-lock.json index 7667720f..ae2f594e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -72,7 +72,7 @@ "next": "14.2.4", "next-themes": "^0.3.0", "postcss": "8.4.38", - "prettier": "^3.3.2", + "prettier": "^3.4.2", "prettier-plugin-tailwindcss": "^0.6.5", "react": "18.3.1", "react-day-picker": "^8.10.1", @@ -9746,9 +9746,10 @@ } }, "node_modules/prettier": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.2.tgz", - "integrity": "sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==", + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.4.2.tgz", + "integrity": "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==", + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index a3ffcac7..f64158f5 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "test:ci": "jest", "build": "next build", "start": "next start", - "format": "prettier --write --log-level warn \"./**/*.{js,jsx,ts,tsx}\"", + "format": "prettier --write --log-level warn \"./**/*.{js,jsx,mjs,ts,tsx}\"", "lint": "eslint --max-warnings 0 \"./**/*.{js,jsx,ts,tsx}\"", "lint:fix": "eslint --max-warnings 0 \"./**/*.{js,jsx,ts,tsx}\" --fix" }, @@ -77,7 +77,7 @@ "next": "14.2.4", "next-themes": "^0.3.0", "postcss": "8.4.38", - "prettier": "^3.3.2", + "prettier": "^3.4.2", "prettier-plugin-tailwindcss": "^0.6.5", "react": "18.3.1", "react-day-picker": "^8.10.1",