From b8eb83fe63f40bc75d1f7cffa0b5ae02f84ba7dd Mon Sep 17 00:00:00 2001 From: Stephen Zhou <38493346+hyoban@users.noreply.github.com> Date: Fri, 19 Sep 2025 22:24:30 +0800 Subject: [PATCH] chore: lint --- .../renderer/src/modules/boost/modal.tsx | 2 +- .../renderer/src/modules/wallet/tip-modal.tsx | 2 +- .../mobile/web-app/html-renderer/package.json | 2 +- eslint.config.mjs | 21 +++++++++++++++++-- .../internal/store/src/modules/entry/hooks.ts | 3 +-- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/apps/desktop/layer/renderer/src/modules/boost/modal.tsx b/apps/desktop/layer/renderer/src/modules/boost/modal.tsx index c8bbe1ac7..431461264 100644 --- a/apps/desktop/layer/renderer/src/modules/boost/modal.tsx +++ b/apps/desktop/layer/renderer/src/modules/boost/modal.tsx @@ -29,7 +29,7 @@ export const BoostModalContent = ({ feedId }: { feedId: string }) => { const balanceBigInt = cPowerBigInt + dPowerBigInt const [amount, setAmount] = useState(0) const amountBigInt = from(amount, 18)[0] - const wrongNumberRange = amountBigInt > balanceBigInt || amountBigInt <= BigInt(0) + const wrongNumberRange = amountBigInt > balanceBigInt || amountBigInt <= 0n const { data: boostStatus, isLoading } = useBoostStatusQuery(feedId) const boostFeedMutation = useBoostFeedMutation() diff --git a/apps/desktop/layer/renderer/src/modules/wallet/tip-modal.tsx b/apps/desktop/layer/renderer/src/modules/wallet/tip-modal.tsx index 16dabb772..8f1cf7a0f 100644 --- a/apps/desktop/layer/renderer/src/modules/wallet/tip-modal.tsx +++ b/apps/desktop/layer/renderer/src/modules/wallet/tip-modal.tsx @@ -63,7 +63,7 @@ const TipModalContent_: FC<{ const amountBigInt = from(amount, 18)[0] - const wrongNumberRange = amountBigInt > balanceBigInt || amountBigInt <= BigInt(0) + const wrongNumberRange = amountBigInt > balanceBigInt || amountBigInt <= 0n const { dismiss } = useCurrentModal() diff --git a/apps/mobile/web-app/html-renderer/package.json b/apps/mobile/web-app/html-renderer/package.json index c046eabcb..880dd649c 100644 --- a/apps/mobile/web-app/html-renderer/package.json +++ b/apps/mobile/web-app/html-renderer/package.json @@ -16,7 +16,7 @@ "clsx": "2.1.1", "foxact": "0.2.49", "jotai": "2.14.0", - "motion": "12.23.13", + "motion": "12.23.16", "react": "19.0.0", "react-blurhash": "0.3.0" } diff --git a/eslint.config.mjs b/eslint.config.mjs index 4f69eff8a..1c032ec94 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -41,8 +41,6 @@ export default defineConfig( "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": 0, "@eslint-react/dom/no-flush-sync": 1, "@eslint-react/hooks-extra/no-unnecessary-use-callback": "warn", - // NOTE: Disable this temporarily - "react-compiler/react-compiler": 0, "unicorn/no-array-callback-reference": 0, "no-restricted-syntax": 0, "no-restricted-globals": [ @@ -54,6 +52,25 @@ export default defineConfig( "You can use `useLocaltion` or `getReadonlyRoute` to get the route info.", }, ], + + // disable react compiler rules for now + "react-hooks/no-unused-directives": "off", + "react-hooks/static-components": "off", + "react-hooks/use-memo": "off", + "react-hooks/component-hook-factories": "off", + "react-hooks/preserve-manual-memoization": "off", + "react-hooks/immutability": "off", + "react-hooks/globals": "off", + "react-hooks/refs": "off", + "react-hooks/set-state-in-effect": "off", + "react-hooks/error-boundaries": "off", + "react-hooks/purity": "off", + "react-hooks/set-state-in-render": "off", + "react-hooks/unsupported-syntax": "off", + "react-hooks/config": "off", + "react-hooks/gating": "off", + + "unicorn/require-module-specifiers": "off", }, }, // use correct tailwind config for eslint diff --git a/packages/internal/store/src/modules/entry/hooks.ts b/packages/internal/store/src/modules/entry/hooks.ts index b93fcb163..7ecef47c4 100644 --- a/packages/internal/store/src/modules/entry/hooks.ts +++ b/packages/internal/store/src/modules/entry/hooks.ts @@ -126,8 +126,7 @@ export const useEntriesQuery = ( } return ( query.data?.pages - ?.map((page) => page.data?.map((entry) => entry.entries.id)) - .flat() + ?.flatMap((page) => page.data?.map((entry) => entry.entries.id)) .filter((id) => typeof id === "string") || [] ) }, [query.data, query.isLoading, query.isError])