From 83dddb8bff6f676bdd29d31a28214300d55b23ae Mon Sep 17 00:00:00 2001 From: Chenyme <118253778+chenyme@users.noreply.github.com> Date: Thu, 16 Jul 2026 13:57:16 +0800 Subject: [PATCH 1/2] refactor: upgrade to TypeScript 7 and update ESLint configuration --- .github/pull_request_template.md | 2 +- .github/workflows/frontend-quality.yml | 56 + .gitignore | 5 +- frontend/BIOME.md | 34 + frontend/README.md | 6 +- frontend/biome.jsonc | 178 ++ .../animate-ui/icons/arrow-right.tsx | 1 - .../animate-ui/icons/audio-lines.tsx | 1 - .../components/animate-ui/icons/binary.tsx | 1 - .../components/animate-ui/icons/blend.tsx | 1 - .../components/animate-ui/icons/blocks.tsx | 1 - .../components/animate-ui/icons/brush.tsx | 1 - .../components/animate-ui/icons/check.tsx | 1 - .../animate-ui/icons/chevron-down.tsx | 1 - .../animate-ui/icons/chevron-left.tsx | 1 - .../animate-ui/icons/chevron-right.tsx | 1 - .../animate-ui/icons/chevron-up.tsx | 1 - .../animate-ui/icons/circuit-board.tsx | 1 - .../animate-ui/icons/clipboard-check.tsx | 1 - .../animate-ui/icons/clipboard-list.tsx | 1 - frontend/components/animate-ui/icons/cog.tsx | 1 - frontend/components/animate-ui/icons/copy.tsx | 1 - frontend/components/animate-ui/icons/crop.tsx | 1 - .../components/animate-ui/icons/disc-3.tsx | 1 - .../components/animate-ui/icons/download.tsx | 1 - .../components/animate-ui/icons/ellipsis.tsx | 1 - .../animate-ui/icons/external-link.tsx | 1 - .../animate-ui/icons/fingerprint.tsx | 1 - .../components/animate-ui/icons/heart.tsx | 1 - frontend/components/animate-ui/icons/icon.tsx | 3 - .../components/animate-ui/icons/layers.tsx | 1 - .../animate-ui/icons/layout-dashboard.tsx | 1 - frontend/components/animate-ui/icons/link.tsx | 1 - frontend/components/animate-ui/icons/list.tsx | 1 - .../animate-ui/icons/message-circle-more.tsx | 1 - .../animate-ui/icons/message-circle.tsx | 1 - .../animate-ui/icons/panel-left.tsx | 1 - .../animate-ui/icons/panel-right.tsx | 1 - .../components/animate-ui/icons/pause.tsx | 1 - .../animate-ui/icons/refresh-cw.tsx | 1 - .../animate-ui/icons/rotate-ccw.tsx | 1 - .../components/animate-ui/icons/search.tsx | 1 - frontend/components/animate-ui/icons/send.tsx | 1 - .../components/animate-ui/icons/sparkle.tsx | 1 - .../components/animate-ui/icons/sparkles.tsx | 1 - .../components/animate-ui/icons/terminal.tsx | 1 - .../animate-ui/icons/thumbs-down.tsx | 1 - .../components/animate-ui/icons/thumbs-up.tsx | 1 - .../components/animate-ui/icons/trash-2.tsx | 1 - .../components/animate-ui/icons/unplug.tsx | 1 - frontend/components/animate-ui/icons/x.tsx | 1 - frontend/components/ui/breadcrumb.tsx | 2 - frontend/components/ui/calendar.tsx | 83 +- frontend/components/ui/chart.tsx | 18 +- frontend/components/ui/field.tsx | 2 +- frontend/components/ui/live-waveform.tsx | 8 +- frontend/components/ui/loading-carousel.tsx | 2 +- frontend/components/ui/logo-carousel.tsx | 1 - frontend/eslint.config.mjs | 10 - .../accounts/accounts-user-editor.tsx | 1 - .../sections/billing/billing-prices.tsx | 1 - .../conversation/admin-conversation.tsx | 1 - .../sections/groups/admin-groups.tsx | 8 +- .../components/sections/login/admin-login.tsx | 2 +- .../components/sections/logs/admin-logs.tsx | 131 - .../models/models-capabilities-config.tsx | 3 +- .../sections/models/models-table.tsx | 11 +- .../sections/shared/task-model-field.tsx | 1 - .../components/sections/tools/admin-tools.tsx | 2 - .../upstreams/upstreams-models-dialog.tsx | 8 +- .../admin/hooks/use-admin-upstreams.ts | 4 +- .../features/admin/model/billing-settings.ts | 1 - .../components/initial-security-guard.tsx | 19 +- .../auth/hooks/use-auth-login-page.ts | 1 + .../message/message-process-trace.tsx | 1 - .../components/message/message-tool-trace.tsx | 20 +- .../components/sections/chat-model-config.tsx | 4 +- .../chat-screenshot-preview-dialog.tsx | 2 - .../chat-screenshot-selection-bar.tsx | 1 - .../chat/hooks/use-chat-attachments.ts | 4 +- frontend/features/chat/hooks/use-chat-data.ts | 10 +- .../chat/hooks/use-chat-message-feedback.ts | 2 +- .../chat/model/upstream-think-store.ts | 4 +- .../sections/content/content-preview.tsx | 5 +- .../features/files/hooks/use-files-page.ts | 11 +- frontend/features/files/types/files.ts | 1 - .../components/navigation/nav-recents.tsx | 1 - .../sections/skills-prompt-page.tsx | 4 +- .../components/sections/skills-section.tsx | 4 +- .../components/sections/recent-header.tsx | 1 - .../components/sections/recent-list.tsx | 1 + .../account/account-active-sessions.tsx | 1 - .../sections/account/account-identities.tsx | 1 - .../account/account-two-factor-dialog.tsx | 17 +- .../subscription/subscription-summary.tsx | 1 - .../settings/hooks/use-settings-account.ts | 1 + frontend/i18n/language-select.tsx | 1 - frontend/i18n/resolve-error-message.ts | 2 +- frontend/next-env.d.ts | 3 +- frontend/next.config.ts | 3 + frontend/package.json | 13 +- frontend/pnpm-lock.yaml | 2656 ++--------------- .../conversation-project-submenu.tsx | 1 - .../shared/components/delete-files-option.tsx | 1 - .../components/devtools-brand-banner.tsx | 9 +- .../file-preview/preview-document.tsx | 2 + .../components/file-preview/preview-pdf.tsx | 8 +- .../components/identity-provider-icon.tsx | 1 - frontend/shared/components/lobehub-icon.tsx | 1 - .../markdown/streamdown-components.tsx | 2 - .../components/markdown/streamdown-content.ts | 7 +- .../components/markdown/streamdown-html.tsx | 7 +- frontend/shared/lib/model-identity.ts | 1 - frontend/shared/lib/qr-code.ts | 9 +- frontend/tsconfig.json | 1 - 115 files changed, 763 insertions(+), 2710 deletions(-) create mode 100644 .github/workflows/frontend-quality.yml create mode 100644 frontend/BIOME.md create mode 100644 frontend/biome.jsonc delete mode 100644 frontend/eslint.config.mjs diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6870ace6..d8a24518 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -28,7 +28,7 @@ ## Verification - + - [ ] Not run; reason: diff --git a/.github/workflows/frontend-quality.yml b/.github/workflows/frontend-quality.yml new file mode 100644 index 00000000..52551570 --- /dev/null +++ b/.github/workflows/frontend-quality.yml @@ -0,0 +1,56 @@ +name: Frontend Quality + +on: + push: + branches: + - main + - dev + paths: + - "frontend/**" + - "scripts/sync-version.mjs" + - "VERSION" + - ".github/workflows/frontend-quality.yml" + pull_request: + branches: + - main + - dev + paths: + - "frontend/**" + - "scripts/sync-version.mjs" + - "VERSION" + - ".github/workflows/frontend-quality.yml" + workflow_dispatch: + +permissions: + contents: read + +jobs: + quality: + name: Biome and TypeScript + runs-on: ubuntu-24.04 + defaults: + run: + working-directory: frontend + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.17.0 + run_install: false + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: 24 + cache: pnpm + cache-dependency-path: frontend/pnpm-lock.yaml + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run frontend checks + run: pnpm check diff --git a/.gitignore b/.gitignore index 88feaeff..4b44a54a 100644 --- a/.gitignore +++ b/.gitignore @@ -51,9 +51,6 @@ web_modules/ # Optional npm cache directory .npm -# Optional eslint cache -.eslintcache - # Optional stylelint cache .stylelintcache @@ -165,4 +162,4 @@ frontend/public/pwa/generated/ docker-compose.local.yml .DS_Store -.idea \ No newline at end of file +.idea diff --git a/frontend/BIOME.md b/frontend/BIOME.md new file mode 100644 index 00000000..959cebe5 --- /dev/null +++ b/frontend/BIOME.md @@ -0,0 +1,34 @@ +# Frontend Biome policy + +DEEIX Chat uses Biome as the frontend linter. TypeScript 7 remains responsible for type checking; ESLint, `typescript-eslint`, and `eslint-config-next` are not part of the frontend toolchain. + +## Commands + +```bash +pnpm check +pnpm typecheck +pnpm lint +pnpm lint:fix +``` + +`pnpm check` is the required non-mutating local and CI gate. It runs `pnpm lint` followed by `pnpm typecheck`. `lint:fix` applies safe Biome lint fixes only. + +Formatting is intentionally outside this migration. Enabling a repository-wide formatter requires a separate mechanical baseline so lint-tooling changes remain reviewable and do not rewrite unrelated application files. + +## Rule policy + +Biome's recommended preset and the recommended React and Next.js domains are enabled in `biome.jsonc`. Project-specific deviations are listed explicitly so an upgrade cannot silently change the pull request gate. + +- `error`: correctness, React hook ordering, duplicate JSX props, invalid React attributes, unsafe script usage, and concrete security defects. Errors fail `pnpm lint`. +- `warn`: accessibility guidance, exhaustive hook dependencies, framework performance guidance, and Next.js conventions that can require project-specific exceptions. Warnings stay visible without blocking an otherwise valid build. +- `off`: only for rules that are not reliable with the project's component abstractions. `useAriaPropsSupportedByRole` is disabled because Radix and polymorphic controls expose roles and ARIA attributes through runtime composition that Biome cannot resolve statically. `performance/noImgElement` is disabled because the application deliberately renders administrator-configured provider icons, arbitrary Markdown/tool images, and local previews whose URLs cannot be declared in a fixed Next image domain list. + +Rule exceptions use file-scoped Biome overrides only for stable framework/library contracts. Inline suppressions are reserved for a single unavoidable statement and must include a reason. File-wide blanket disables and category-wide exceptions are not accepted. + +The Animate UI registry owns `components/animate-ui/icons/icon.tsx` and exports its hook-backed helper as `getVariants`. That upstream API name is preserved so newly downloaded or overwritten registry components remain compatible; the Hook naming rule is disabled only for that exact registry-owned file. + +## Migration coverage + +Biome covers the correctness, hooks, accessibility, security, and performance rules that can be mapped from the former Next.js ESLint configuration. Biome 2.5 does not yet implement every React Compiler rule or every Next.js-specific rule. TypeScript and Next.js builds remain required checks, and unsupported rules should be reconsidered when Biome adds native equivalents. + +Notable unsupported groups include React Compiler diagnostics such as immutability, refs, purity, set-state-in-render, and static component analysis, plus Next.js rules for page-specific HTML, Head, Script, and relative `location` assignments. These gaps are documented rather than hidden behind a second TypeScript runtime. diff --git a/frontend/README.md b/frontend/README.md index 3425d2fd..ffb89c73 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -147,12 +147,14 @@ NEXT_PUBLIC_API_BASE_URL=http://127.0.0.1:8080 ```bash pnpm dev +pnpm check pnpm lint +pnpm lint:fix pnpm build pnpm start ``` -当前 `package.json` 未配置单独的 `typecheck` 脚本,需要类型检查时使用框架构建或临时执行 TypeScript 检查命令。 +`check` 依次运行 Biome 静态检查和 TypeScript 7 类型检查。规则范围、严重级别和框架例外见 [BIOME.md](./BIOME.md)。 ## 开发约束 @@ -170,7 +172,7 @@ pnpm start ## 提交前验证 ```bash -pnpm lint +pnpm check ``` 涉及构建、路由、依赖或 Next.js 配置变更时再执行: diff --git a/frontend/biome.jsonc b/frontend/biome.jsonc new file mode 100644 index 00000000..827533cf --- /dev/null +++ b/frontend/biome.jsonc @@ -0,0 +1,178 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.5.4/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "ignoreUnknown": true, + "includes": [ + "**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}", + "!node_modules", + "!.next", + "!out", + "!build", + "!next-env.d.ts", + "!public/sw.js", + "!public/vendor", + "!shared/generated" + ] + }, + "formatter": { + "enabled": false + }, + "linter": { + "enabled": true, + "domains": { + "next": "recommended", + "react": "recommended" + }, + "rules": { + "preset": "recommended", + "a11y": { + "noLabelWithoutControl": "off", + "noStaticElementInteractions": "off", + "noSvgWithoutTitle": "off", + "useAriaPropsSupportedByRole": "off", + "useSemanticElements": "off" + }, + "correctness": { + "noUnusedFunctionParameters": "off", + "useExhaustiveDependencies": { + "level": "warn", + "options": { + "reportUnnecessaryDependencies": false + } + }, + "useImageSize": "off" + }, + "nursery": { + "noComponentHookFactories": "error", + "noReactStringRefs": "error" + }, + "performance": { + "noBarrelFile": "off", + "noImgElement": "off", + "noNamespaceImport": "off", + "useTopLevelRegex": "off" + }, + "suspicious": { + "noAlert": "off", + "noArrayIndexKey": "off", + "noDocumentCookie": "off", + "noEmptyBlockStatements": "off", + "noShadowRestrictedNames": "off", + "useAwait": "off" + }, + "complexity": { + "noExcessiveCognitiveComplexity": "off", + "noUselessFragments": "off", + "noUselessSwitchCase": "off", + "useOptionalChain": "off" + }, + "style": { + "noNestedTernary": "off", + "noNonNullAssertion": "off", + "useBlockStatements": "off", + "useConsistentTypeDefinitions": "off", + "useConst": "off", + "useImportType": "off" + } + } + }, + "overrides": [ + { + "includes": ["components/animate-ui/icons/icon.tsx"], + "linter": { + "rules": { + "correctness": { + "useExhaustiveDependencies": "off", + "useHookAtTopLevel": "off" + } + } + } + }, + { + "includes": ["components/animate-ui/utils/get-strict-context.tsx"], + "linter": { + "rules": { + "nursery": { + "noComponentHookFactories": "off" + } + } + } + }, + { + "includes": ["shared/components/file-preview/preview-docx.tsx"], + "linter": { + "rules": { + "suspicious": { + "noUnknownAttribute": "off" + } + } + } + }, + { + "includes": [ + "components/ui/live-waveform.tsx", + "components/ui/virtual-table.tsx", + "shared/components/file-preview/preview-document.tsx" + ], + "linter": { + "rules": { + "a11y": { + "noAriaHiddenOnFocusable": "off" + } + } + } + }, + { + "includes": [ + "features/admin/components/sections/billing/billing-redemption.tsx", + "features/chat/components/message/message-meta.tsx" + ], + "linter": { + "rules": { + "a11y": { + "noNoninteractiveTabindex": "off" + } + } + } + }, + { + "includes": [ + "features/chat/components/sections/chat-input.tsx", + "features/layouts/components/navigation/sidebar-conversation-item.tsx", + "features/settings/components/sections/chat/settings-chat.tsx" + ], + "linter": { + "rules": { + "a11y": { + "noAutofocus": "off" + } + } + } + }, + { + "includes": ["shared/components/file-preview/preview-media.tsx"], + "linter": { + "rules": { + "a11y": { + "useMediaCaption": "off" + } + } + } + }, + { + "includes": ["components/ui/input-group.tsx"], + "linter": { + "rules": { + "a11y": { + "useKeyWithClickEvents": "off" + } + } + } + } + ] +} diff --git a/frontend/components/animate-ui/icons/arrow-right.tsx b/frontend/components/animate-ui/icons/arrow-right.tsx index 336ff086..9b8fcf2f 100644 --- a/frontend/components/animate-ui/icons/arrow-right.tsx +++ b/frontend/components/animate-ui/icons/arrow-right.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/audio-lines.tsx b/frontend/components/animate-ui/icons/audio-lines.tsx index 30e56e5a..45524f8c 100644 --- a/frontend/components/animate-ui/icons/audio-lines.tsx +++ b/frontend/components/animate-ui/icons/audio-lines.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/binary.tsx b/frontend/components/animate-ui/icons/binary.tsx index a562d92f..171cf101 100644 --- a/frontend/components/animate-ui/icons/binary.tsx +++ b/frontend/components/animate-ui/icons/binary.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/blend.tsx b/frontend/components/animate-ui/icons/blend.tsx index 9215364b..68cad333 100644 --- a/frontend/components/animate-ui/icons/blend.tsx +++ b/frontend/components/animate-ui/icons/blend.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/blocks.tsx b/frontend/components/animate-ui/icons/blocks.tsx index c1dedc73..9db1ee0e 100644 --- a/frontend/components/animate-ui/icons/blocks.tsx +++ b/frontend/components/animate-ui/icons/blocks.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/brush.tsx b/frontend/components/animate-ui/icons/brush.tsx index 2b62950f..2d3646ac 100644 --- a/frontend/components/animate-ui/icons/brush.tsx +++ b/frontend/components/animate-ui/icons/brush.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/check.tsx b/frontend/components/animate-ui/icons/check.tsx index 56deaadc..41cf019c 100644 --- a/frontend/components/animate-ui/icons/check.tsx +++ b/frontend/components/animate-ui/icons/check.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/chevron-down.tsx b/frontend/components/animate-ui/icons/chevron-down.tsx index 35cbe7a4..f8887b44 100644 --- a/frontend/components/animate-ui/icons/chevron-down.tsx +++ b/frontend/components/animate-ui/icons/chevron-down.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/chevron-left.tsx b/frontend/components/animate-ui/icons/chevron-left.tsx index 6531bc80..8b335f62 100644 --- a/frontend/components/animate-ui/icons/chevron-left.tsx +++ b/frontend/components/animate-ui/icons/chevron-left.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/chevron-right.tsx b/frontend/components/animate-ui/icons/chevron-right.tsx index 232df0e6..cd78bcc2 100644 --- a/frontend/components/animate-ui/icons/chevron-right.tsx +++ b/frontend/components/animate-ui/icons/chevron-right.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/chevron-up.tsx b/frontend/components/animate-ui/icons/chevron-up.tsx index 7cab5e53..c1a33402 100644 --- a/frontend/components/animate-ui/icons/chevron-up.tsx +++ b/frontend/components/animate-ui/icons/chevron-up.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/circuit-board.tsx b/frontend/components/animate-ui/icons/circuit-board.tsx index c55ceb33..2ae29e0d 100644 --- a/frontend/components/animate-ui/icons/circuit-board.tsx +++ b/frontend/components/animate-ui/icons/circuit-board.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/clipboard-check.tsx b/frontend/components/animate-ui/icons/clipboard-check.tsx index 9548464f..6c1e9250 100644 --- a/frontend/components/animate-ui/icons/clipboard-check.tsx +++ b/frontend/components/animate-ui/icons/clipboard-check.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/clipboard-list.tsx b/frontend/components/animate-ui/icons/clipboard-list.tsx index acc72019..b4c38c56 100644 --- a/frontend/components/animate-ui/icons/clipboard-list.tsx +++ b/frontend/components/animate-ui/icons/clipboard-list.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/cog.tsx b/frontend/components/animate-ui/icons/cog.tsx index b17690c7..d3e3ec7c 100644 --- a/frontend/components/animate-ui/icons/cog.tsx +++ b/frontend/components/animate-ui/icons/cog.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/copy.tsx b/frontend/components/animate-ui/icons/copy.tsx index c8ec5d9d..a0f49a67 100644 --- a/frontend/components/animate-ui/icons/copy.tsx +++ b/frontend/components/animate-ui/icons/copy.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/crop.tsx b/frontend/components/animate-ui/icons/crop.tsx index 0c04fea7..98606202 100644 --- a/frontend/components/animate-ui/icons/crop.tsx +++ b/frontend/components/animate-ui/icons/crop.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/disc-3.tsx b/frontend/components/animate-ui/icons/disc-3.tsx index db8e9319..a16a4491 100644 --- a/frontend/components/animate-ui/icons/disc-3.tsx +++ b/frontend/components/animate-ui/icons/disc-3.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/download.tsx b/frontend/components/animate-ui/icons/download.tsx index 487aa0e4..c508038e 100644 --- a/frontend/components/animate-ui/icons/download.tsx +++ b/frontend/components/animate-ui/icons/download.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/ellipsis.tsx b/frontend/components/animate-ui/icons/ellipsis.tsx index 5950cf27..7b4ec943 100644 --- a/frontend/components/animate-ui/icons/ellipsis.tsx +++ b/frontend/components/animate-ui/icons/ellipsis.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/external-link.tsx b/frontend/components/animate-ui/icons/external-link.tsx index be13a3c1..ae0f72ea 100644 --- a/frontend/components/animate-ui/icons/external-link.tsx +++ b/frontend/components/animate-ui/icons/external-link.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/fingerprint.tsx b/frontend/components/animate-ui/icons/fingerprint.tsx index e5eece52..86cb8c35 100644 --- a/frontend/components/animate-ui/icons/fingerprint.tsx +++ b/frontend/components/animate-ui/icons/fingerprint.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/heart.tsx b/frontend/components/animate-ui/icons/heart.tsx index fd918316..65af1484 100644 --- a/frontend/components/animate-ui/icons/heart.tsx +++ b/frontend/components/animate-ui/icons/heart.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/icon.tsx b/frontend/components/animate-ui/icons/icon.tsx index b814808f..542355b8 100644 --- a/frontend/components/animate-ui/icons/icon.tsx +++ b/frontend/components/animate-ui/icons/icon.tsx @@ -213,7 +213,6 @@ function AnimateIcon({ setCurrentAnimation(typeof animate === 'string' ? animate : animation); if (animate) startAnimation(animate as TriggerProp); else stopAnimation(); - // eslint-disable-next-line react-hooks/exhaustive-deps }, [animate]); React.useEffect(() => { @@ -372,7 +371,6 @@ function AnimateIcon({ loopDelayRef.current = null; } }; - // eslint-disable-next-line react-hooks/exhaustive-deps }, [localAnimate, controls]); const childProps = React.isValidElement(children) @@ -622,7 +620,6 @@ function getVariants< V extends { default: T; [key: string]: T }, T extends Record, >(animations: V): T { - // eslint-disable-next-line react-hooks/rules-of-hooks const { animation: animationType } = useAnimateIconContext(); let result: T; diff --git a/frontend/components/animate-ui/icons/layers.tsx b/frontend/components/animate-ui/icons/layers.tsx index a7f264b4..c18e780f 100644 --- a/frontend/components/animate-ui/icons/layers.tsx +++ b/frontend/components/animate-ui/icons/layers.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/layout-dashboard.tsx b/frontend/components/animate-ui/icons/layout-dashboard.tsx index 731d383f..25d831ef 100644 --- a/frontend/components/animate-ui/icons/layout-dashboard.tsx +++ b/frontend/components/animate-ui/icons/layout-dashboard.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/link.tsx b/frontend/components/animate-ui/icons/link.tsx index 4bc0a4f6..8bf1f66c 100644 --- a/frontend/components/animate-ui/icons/link.tsx +++ b/frontend/components/animate-ui/icons/link.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/list.tsx b/frontend/components/animate-ui/icons/list.tsx index cb1f372b..12749e01 100644 --- a/frontend/components/animate-ui/icons/list.tsx +++ b/frontend/components/animate-ui/icons/list.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/message-circle-more.tsx b/frontend/components/animate-ui/icons/message-circle-more.tsx index bd417a90..14390722 100644 --- a/frontend/components/animate-ui/icons/message-circle-more.tsx +++ b/frontend/components/animate-ui/icons/message-circle-more.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/message-circle.tsx b/frontend/components/animate-ui/icons/message-circle.tsx index e984997f..e66c0546 100644 --- a/frontend/components/animate-ui/icons/message-circle.tsx +++ b/frontend/components/animate-ui/icons/message-circle.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/panel-left.tsx b/frontend/components/animate-ui/icons/panel-left.tsx index 02ad252a..90a6d717 100644 --- a/frontend/components/animate-ui/icons/panel-left.tsx +++ b/frontend/components/animate-ui/icons/panel-left.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/panel-right.tsx b/frontend/components/animate-ui/icons/panel-right.tsx index f1646a96..1b82b8db 100644 --- a/frontend/components/animate-ui/icons/panel-right.tsx +++ b/frontend/components/animate-ui/icons/panel-right.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/pause.tsx b/frontend/components/animate-ui/icons/pause.tsx index da226c68..95dd2a2a 100644 --- a/frontend/components/animate-ui/icons/pause.tsx +++ b/frontend/components/animate-ui/icons/pause.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/refresh-cw.tsx b/frontend/components/animate-ui/icons/refresh-cw.tsx index 7ff66229..6d683ff5 100644 --- a/frontend/components/animate-ui/icons/refresh-cw.tsx +++ b/frontend/components/animate-ui/icons/refresh-cw.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/rotate-ccw.tsx b/frontend/components/animate-ui/icons/rotate-ccw.tsx index 9011d353..09ee1868 100644 --- a/frontend/components/animate-ui/icons/rotate-ccw.tsx +++ b/frontend/components/animate-ui/icons/rotate-ccw.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/search.tsx b/frontend/components/animate-ui/icons/search.tsx index 5377b7bb..9c6b83f0 100644 --- a/frontend/components/animate-ui/icons/search.tsx +++ b/frontend/components/animate-ui/icons/search.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/send.tsx b/frontend/components/animate-ui/icons/send.tsx index 65d70f2c..613a7777 100644 --- a/frontend/components/animate-ui/icons/send.tsx +++ b/frontend/components/animate-ui/icons/send.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/sparkle.tsx b/frontend/components/animate-ui/icons/sparkle.tsx index d98dedf6..a3b646f0 100644 --- a/frontend/components/animate-ui/icons/sparkle.tsx +++ b/frontend/components/animate-ui/icons/sparkle.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/sparkles.tsx b/frontend/components/animate-ui/icons/sparkles.tsx index 43d4fb9a..064332b6 100644 --- a/frontend/components/animate-ui/icons/sparkles.tsx +++ b/frontend/components/animate-ui/icons/sparkles.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/terminal.tsx b/frontend/components/animate-ui/icons/terminal.tsx index 49f18a8c..b02a4a93 100644 --- a/frontend/components/animate-ui/icons/terminal.tsx +++ b/frontend/components/animate-ui/icons/terminal.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/thumbs-down.tsx b/frontend/components/animate-ui/icons/thumbs-down.tsx index bd342275..7f4d56a0 100644 --- a/frontend/components/animate-ui/icons/thumbs-down.tsx +++ b/frontend/components/animate-ui/icons/thumbs-down.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/thumbs-up.tsx b/frontend/components/animate-ui/icons/thumbs-up.tsx index a6fac3e4..dc7b98e3 100644 --- a/frontend/components/animate-ui/icons/thumbs-up.tsx +++ b/frontend/components/animate-ui/icons/thumbs-up.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/trash-2.tsx b/frontend/components/animate-ui/icons/trash-2.tsx index 4b49507d..b5f4400c 100644 --- a/frontend/components/animate-ui/icons/trash-2.tsx +++ b/frontend/components/animate-ui/icons/trash-2.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/unplug.tsx b/frontend/components/animate-ui/icons/unplug.tsx index ac0a59d5..bb0af738 100644 --- a/frontend/components/animate-ui/icons/unplug.tsx +++ b/frontend/components/animate-ui/icons/unplug.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/animate-ui/icons/x.tsx b/frontend/components/animate-ui/icons/x.tsx index bb2d4f4d..7507595a 100644 --- a/frontend/components/animate-ui/icons/x.tsx +++ b/frontend/components/animate-ui/icons/x.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { motion, type Variants } from 'motion/react'; import { diff --git a/frontend/components/ui/breadcrumb.tsx b/frontend/components/ui/breadcrumb.tsx index 2cda54f7..05cb1308 100644 --- a/frontend/components/ui/breadcrumb.tsx +++ b/frontend/components/ui/breadcrumb.tsx @@ -53,8 +53,6 @@ function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) { return ( ( +
+) + +const CalendarChevron: CustomComponents["Chevron"] = ({ + className, + orientation, + ...props +}) => { + if (orientation === "left") { + return + } + + if (orientation === "right") { + return + } + + return +} + +const CalendarWeekNumber: CustomComponents["WeekNumber"] = ({ + children, + ...props +}) => ( + +
+ {children} +
+ +) + function Calendar({ className, classNames, @@ -132,46 +173,10 @@ function Calendar({ ...classNames, }} components={{ - Root: ({ className, rootRef, ...props }) => { - return ( -
- ) - }, - Chevron: ({ className, orientation, ...props }) => { - if (orientation === "left") { - return ( - - ) - } - - if (orientation === "right") { - return ( - - ) - } - - return ( - - ) - }, + Root: CalendarRoot, + Chevron: CalendarChevron, DayButton: CalendarDayButton, - WeekNumber: ({ children, ...props }) => { - return ( - -
- {children} -
- - ) - }, + WeekNumber: CalendarWeekNumber, ...components, }} {...props} diff --git a/frontend/components/ui/chart.tsx b/frontend/components/ui/chart.tsx index 013672b2..ed3a7b9b 100644 --- a/frontend/components/ui/chart.tsx +++ b/frontend/components/ui/chart.tsx @@ -98,12 +98,9 @@ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => { return null } - return ( - } const ChartTooltip = RechartsPrimitive.Tooltip diff --git a/frontend/components/ui/field.tsx b/frontend/components/ui/field.tsx index bb027485..914b138b 100644 --- a/frontend/components/ui/field.tsx +++ b/frontend/components/ui/field.tsx @@ -205,7 +205,7 @@ function FieldError({ ...new Map(errors.map((error) => [error?.message, error])).values(), ] - if (uniqueErrors?.length == 1) { + if (uniqueErrors?.length === 1) { return uniqueErrors[0]?.message } diff --git a/frontend/components/ui/live-waveform.tsx b/frontend/components/ui/live-waveform.tsx index 968828fb..a244a5a9 100644 --- a/frontend/components/ui/live-waveform.tsx +++ b/frontend/components/ui/live-waveform.tsx @@ -254,7 +254,9 @@ export const LiveWaveform = ({ useEffect(() => { if (!active) { if (streamRef.current) { - streamRef.current.getTracks().forEach((track) => track.stop()) + streamRef.current.getTracks().forEach((track) => { + track.stop() + }) streamRef.current = null onStreamEnd?.() } @@ -317,7 +319,9 @@ export const LiveWaveform = ({ return () => { if (streamRef.current) { - streamRef.current.getTracks().forEach((track) => track.stop()) + streamRef.current.getTracks().forEach((track) => { + track.stop() + }) streamRef.current = null onStreamEnd?.() } diff --git a/frontend/components/ui/loading-carousel.tsx b/frontend/components/ui/loading-carousel.tsx index 3a554c10..b683a51e 100644 --- a/frontend/components/ui/loading-carousel.tsx +++ b/frontend/components/ui/loading-carousel.tsx @@ -7,7 +7,6 @@ import { AnimatePresence, motion, MotionProps, - useAnimation, Variants, } from "motion/react" @@ -241,6 +240,7 @@ export function LoadingCarousel({
{displayTips.map((_, index) => (