From 62cf01af419f824db76227b22b5d4553d2132c04 Mon Sep 17 00:00:00 2001 From: Miguel Piedrafita Date: Fri, 8 Nov 2024 06:24:23 +0000 Subject: [PATCH] lint --- .github/workflows/relyance-sci.yml | 26 +++++++++---------- cspell.json | 16 ++---------- examples/with-html/index.html | 2 +- packages/core/src/lib/hashing.ts | 2 +- .../IDKitWidget/States/WorldID/QRState.tsx | 11 ++++---- .../IDKitWidget/States/WorldIDState.tsx | 4 +-- packages/react/src/components/QRCode.tsx | 13 ++++++---- packages/react/src/lang/index.ts | 4 +-- packages/react/tsup.config.ts | 2 +- 9 files changed, 36 insertions(+), 44 deletions(-) diff --git a/.github/workflows/relyance-sci.yml b/.github/workflows/relyance-sci.yml index 1462102d..5a890428 100644 --- a/.github/workflows/relyance-sci.yml +++ b/.github/workflows/relyance-sci.yml @@ -1,20 +1,20 @@ name: Relyance SCI Scan on: - schedule: - - cron: "0 20 * * *" - workflow_dispatch: + schedule: + - cron: '0 20 * * *' + workflow_dispatch: jobs: - execute-relyance-sci: - name: Relyance SCI Job - runs-on: ubuntu-latest + execute-relyance-sci: + name: Relyance SCI Job + runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Pull and run SCI binary - run: |- - docker pull gcr.io/relyance-ext/compliance_inspector:release && \ - docker run --rm -v `pwd`:/repo --env API_KEY='${{ secrets.DPP_SCI_KEY }}' gcr.io/relyance-ext/compliance_inspector:release + - name: Pull and run SCI binary + run: |- + docker pull gcr.io/relyance-ext/compliance_inspector:release && \ + docker run --rm -v `pwd`:/repo --env API_KEY='${{ secrets.DPP_SCI_KEY }}' gcr.io/relyance-ext/compliance_inspector:release diff --git a/cspell.json b/cspell.json index d39ca7a8..6c41dc86 100644 --- a/cspell.json +++ b/cspell.json @@ -3,20 +3,8 @@ "enabled": true, "language": "en-US", "allowCompoundWords": true, - "dictionaries": [ - "typescript", - "node", - "npm", - "html" - ], - "enabledLanguageIds": [ - "typescript", - "typescriptreact", - "javascript", - "markdown", - "yaml", - "json" - ], + "dictionaries": ["typescript", "node", "npm", "html"], + "enabledLanguageIds": ["typescript", "typescriptreact", "javascript", "markdown", "yaml", "json"], "words": [ "arrayify", "consts", diff --git a/examples/with-html/index.html b/examples/with-html/index.html index fc9088bf..8295b244 100644 --- a/examples/with-html/index.html +++ b/examples/with-html/index.html @@ -1,4 +1,4 @@ - + diff --git a/packages/core/src/lib/hashing.ts b/packages/core/src/lib/hashing.ts index decd6e62..356977cd 100644 --- a/packages/core/src/lib/hashing.ts +++ b/packages/core/src/lib/hashing.ts @@ -1,7 +1,7 @@ import { Buffer } from 'buffer/index.js' import type { IDKitConfig } from '@/types/config' -import type { AbiEncodedValue } from '@/types/config' import { AbiParameters, Bytes, Hex, Hash } from 'ox' +import type { AbiEncodedValue } from '@/types/config' export interface HashFunctionOutput { hash: bigint diff --git a/packages/react/src/components/IDKitWidget/States/WorldID/QRState.tsx b/packages/react/src/components/IDKitWidget/States/WorldID/QRState.tsx index 2042fcc4..1e221ca4 100644 --- a/packages/react/src/components/IDKitWidget/States/WorldID/QRState.tsx +++ b/packages/react/src/components/IDKitWidget/States/WorldID/QRState.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx' import { __ } from '@/lang' import type { FC } from 'react' import copy from 'copy-to-clipboard' @@ -8,7 +9,6 @@ import { useCallback, useState } from 'react' import { AnimatePresence, motion } from 'framer-motion' import WorldcoinIcon from '@/components/Icons/WorldcoinIcon' import QRPlaceholderIcon from '@/components/Icons/QRPlaceholderIcon' -import clsx from 'clsx' type Props = { qrData: string | null @@ -29,7 +29,7 @@ const QRState: FC = ({ qrData, showQR, setShowQR }) => { return ( <> -
+
= ({ qrData, showQR, setShowQR }) => { layoutId={media == 'desktop' ? undefined : 'worldid-button'} className={clsx( 'flex w-full items-center space-x-2 rounded-2xl border border-transparent p-4 font-medium shadow-sm', - 'bg-0d151d text-white dark:bg-white dark:text-0d151d', {hidden: showQR} + 'bg-0d151d text-white dark:bg-white dark:text-0d151d', + { hidden: showQR } )} > @@ -50,8 +51,8 @@ const QRState: FC = ({ qrData, showQR, setShowQR }) => { {__('Open Worldcoin App')} -
-
+
+

or
diff --git a/packages/react/src/components/IDKitWidget/States/WorldIDState.tsx b/packages/react/src/components/IDKitWidget/States/WorldIDState.tsx index d6ffe71f..5f4715ca 100644 --- a/packages/react/src/components/IDKitWidget/States/WorldIDState.tsx +++ b/packages/react/src/components/IDKitWidget/States/WorldIDState.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx' import { __ } from '@/lang' import { IDKITStage } from '@/types' import QRState from './WorldID/QRState' @@ -9,7 +10,6 @@ import { useWorldBridge } from '@/services/wld-bridge' import LoadingIcon from '@/components/Icons/LoadingIcon' import WorldcoinIcon from '@/components/Icons/WorldcoinIcon' import { AppErrorCodes, VerificationState, VerificationLevel } from '@worldcoin/idkit-core' -import clsx from 'clsx' const getOptions = (store: IDKitStore) => ({ signal: store.signal, @@ -68,7 +68,7 @@ const WorldIDState = () => { }, [result, handleVerify, verificationState, setStage, errorCode, setErrorState, verification_level]) return ( -
+
diff --git a/packages/react/src/components/QRCode.tsx b/packages/react/src/components/QRCode.tsx index 2968f427..de24db5c 100644 --- a/packages/react/src/components/QRCode.tsx +++ b/packages/react/src/components/QRCode.tsx @@ -7,12 +7,15 @@ const generateMatrix = (data: string): Array => { const arr = QRCodeUtil.create(data, { errorCorrectionLevel: 'M' }).modules.data as Uint8Array const sqrt = Math.sqrt(arr.length) - return arr.reduce((rows, key, index) => { - if (index % sqrt === 0) rows.push([key]) - else rows[rows.length - 1].push(key) + return arr.reduce( + (rows, key, index) => { + if (index % sqrt === 0) rows.push([key]) + else rows[rows.length - 1].push(key) - return rows - }, [] as Array) + return rows + }, + [] as Array + ) } type Props = { diff --git a/packages/react/src/lang/index.ts b/packages/react/src/lang/index.ts index 00c0cda1..d6029a8d 100644 --- a/packages/react/src/lang/index.ts +++ b/packages/react/src/lang/index.ts @@ -12,8 +12,8 @@ const getLang = (): Record | undefined => { type CleanWord = T extends `${string}${' ' | ',' | '!' | '?' | '.' | '`'}${string}` ? never : T extends '' - ? never - : T + ? never + : T type ExtractPlaceholders = S extends `${string}:${infer Placeholder}` ? Placeholder extends `${infer Word}${' ' | ',' | '!' | '?' | '.' | '`'}${infer Rest}` diff --git a/packages/react/tsup.config.ts b/packages/react/tsup.config.ts index f2a00eea..06cc88ce 100644 --- a/packages/react/tsup.config.ts +++ b/packages/react/tsup.config.ts @@ -1,5 +1,5 @@ import { defineConfig } from 'tsup' -import packageJson from './package.json' assert { type: 'json' } +import packageJson from './package.json' assert {} export default defineConfig({ dts: true,