Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

🔧 chore(lint): migrate ESLint to Oxlint and limit stylelint to CSS/Less (#22084)

Inneicbcc23be44d2
diff --git a/.agents/scripts/check/check.test.ts b/.agents/scripts/check/check.test.ts
index 39e82714ab9..80a4941a855 100644
--- a/.agents/scripts/check/check.test.ts
+++ b/.agents/scripts/check/check.test.ts
@@ -49,9 +49,13 @@ describe('resolveMount', () => {
});
describe('pipelineFor', () => {
- it('maps ts/tsx to the stylelint+eslint+prettier pipeline', () => {
+ it('maps ts/tsx to the oxlint+prettier pipeline and css to stylelint+prettier', () => {
const pipeline = pipelineFor(lobehubPipelines, 'src/auth.ts');
- expect(pipeline?.tools.map(([tool]) => tool)).toEqual(['stylelint', 'eslint', 'prettier']);
+ expect(pipeline?.tools.map(([tool]) => tool)).toEqual(['oxlint', 'prettier']);
+ expect(pipelineFor(lobehubPipelines, 'src/a.module.css')?.tools.map(([tool]) => tool)).toEqual([
+ 'stylelint',
+ 'prettier',
+ ]);
});
it('maps md to remark+prettier and json to prettier only', () => {
@@ -65,7 +69,7 @@ describe('pipelineFor', () => {
});
it('returns null for extensions with no pipeline', () => {
- expect(pipelineFor(lobehubPipelines, '.github/workflows/ci.yml')).not.toBeNull();
+ expect(pipelineFor(lobehubPipelines, '.github/workflows/ci.yml')).toBeNull();
expect(pipelineFor(lobehubPipelines, 'image.png')).toBeNull();
expect(pipelineFor([], 'a.ts')).toBeNull();
});
@@ -105,11 +109,10 @@ describe('lobehubPipelines drift', () => {
describe('stylelintApplies', () => {
it('scopes stylelint to src/tests like the lint:style scripts', () => {
- expect(stylelintApplies('src/auth.ts')).toBe(true);
- expect(stylelintApplies('tests/foo.ts')).toBe(true);
- // stylelint's CSS-in-JS fixer corrupts files outside its configured scope
- expect(stylelintApplies('.agents/scripts/check/index.ts')).toBe(false);
- expect(stylelintApplies('packages/utils/src/a.ts')).toBe(false);
+ expect(stylelintApplies('src/auth.css')).toBe(true);
+ expect(stylelintApplies('tests/foo.less')).toBe(true);
+ expect(stylelintApplies('.agents/scripts/check/style.css')).toBe(false);
+ expect(stylelintApplies('packages/utils/src/a.css')).toBe(false);
});
});
diff --git a/.agents/scripts/check/index.ts b/.agents/scripts/check/index.ts
index f1f626422e6..c4c25ffac6d 100644
--- a/.agents/scripts/check/index.ts
+++ b/.agents/scripts/check/index.ts
@@ -4,7 +4,7 @@
* Agent-oriented quality check engine: `bun run check [files...] [--lint] [--test] [--type]`.
*
* Runs the lint-staged toolchain (with autofix) and/or related tests on the
- * given files, auto-routing each file to the right eslint/stylelint config
+ * given files, auto-routing each file to the right oxlint/stylelint config
* root (the host repo or a mounted sub-repo) and the nearest owning vitest
* config. Output is compact and colorless so agents burn minimal tokens
* reading it.
diff --git a/.agents/scripts/check/lint.ts b/.agents/scripts/check/lint.ts
index a502496fce1..0f5fb28051b 100644
--- a/.agents/scripts/check/lint.ts
+++ b/.agents/scripts/check/lint.ts
@@ -7,24 +7,25 @@ import type { LintOutcome, LintProblem, RepoMount } from './types';
const filePrefix = (mount: RepoMount) => (mount.dir === '' ? '' : `${mount.dir}/`);
-const parseEslintJson = (stdout: string, mount: RepoMount): LintProblem[] | null => {
+const parseOxlintJson = (stdout: string, mount: RepoMount): LintProblem[] | null => {
try {
- const results = JSON.parse(stdout) as {
- filePath: string;
- messages: { line?: number; message: string; ruleId: string | null; severity: number }[];
- }[];
- return results.flatMap((result) =>
- result.messages
- // ruleId=null entries are eslint's own notices (e.g. ignored-file warnings)
- .filter((message) => message.ruleId !== null)
- .map((message) => ({
- file: filePrefix(mount) + path.relative(mountDir(mount), result.filePath),
- line: message.line ?? 0,
- message: message.message,
- rule: message.ruleId ?? '',
- severity: message.severity === 2 ? ('error' as const) : ('warning' as const),
- })),
- );
+ const { diagnostics } = JSON.parse(stdout) as {
+ diagnostics: {
+ code?: string;
+ filename: string;
+ labels?: { span: { line?: number } }[];
+ message: string;
+ severity: string;
+ }[];
+ };
+ return diagnostics.map((diagnostic) => ({
+ file: filePrefix(mount) + diagnostic.filename,
+ line: diagnostic.labels?.[0]?.span.line ?? 0,
+ message: diagnostic.message,
+ // code-less diagnostics are oxlint's own notices (e.g. unused disable directives)
+ rule: diagnostic.code ?? '',
+ severity: diagnostic.severity === 'error' ? ('error' as const) : ('warning' as const),
+ }));
} catch {
return null;
}
@@ -62,17 +63,13 @@ export const lintGroup = async (
for (const toolArgs of tools) {
const [tool] = toolArgs;
- if (tool === 'eslint') {
- const result = await runTool(
- mount,
- [...toolArgs, '--format', 'json', '--no-warn-ignored'],
- subPaths,
- );
- const problems = parseEslintJson(result.stdout, mount);
+ if (tool === 'oxlint') {
+ const result = await runTool(mount, [...toolArgs, '--format', 'json'], subPaths);
+ const problems = parseOxlintJson(result.stdout, mount);
if (problems) outcome.problems.push(...problems);
else if (result.code !== 0)
outcome.fatal.push(
- `eslint(${mountLabel(mount)}): ${result.stderr.trim() || result.stdout.trim()}`,
+ `oxlint(${mountLabel(mount)}): ${result.stderr.trim() || result.stdout.trim()}`,
);
} else if (tool === 'stylelint') {
const scoped = subPaths.filter((subPath) => stylelintApplies(subPath));
diff --git a/.agents/scripts/check/pipelines.ts b/.agents/scripts/check/pipelines.ts
index 15468c5600b..b6fe84c1f2a 100644
--- a/.agents/scripts/check/pipelines.ts
+++ b/.agents/scripts/check/pipelines.ts
@@ -16,35 +16,36 @@ export const lobehubPipelines: PipelineEntry[] = [
},
{
exts: ['.mdx'],
- tools: [
- ['remark', '-r', './.remarkrc.mdx.mjs', '--silent', '--output', '--'],
- ['eslint', '--quiet', '--fix'],
- ],
+ tools: [['remark', '-r', './.remarkrc.mdx.mjs', '--silent', '--output', '--']],
},
{ exts: ['.json'], tools: [['prettier', '--write']] },
{
exts: ['.mjs', '.cjs'],
tools: [
- ['eslint', '--fix'],
+ ['oxlint', '--fix'],
['prettier', '--write'],
],
},
{
exts: ['.js', '.jsx'],
tools: [
- ['eslint', '--fix'],
- ['stylelint', '--fix'],
+ ['oxlint', '--fix'],
['prettier', '--write'],
],
},
{
// .mts/.cts are outside lint-staged's globs but belong to the same pipeline
exts: ['.ts', '.tsx', '.mts', '.cts'],
+ tools: [
+ ['oxlint', '--fix'],
+ ['prettier', '--write'],
+ ],
+ },
+ {
+ exts: ['.css', '.less'],
tools: [
['stylelint', '--fix'],
- ['eslint', '--fix'],
['prettier', '--write'],
],
},
- { exts: ['.yml', '.yaml'], tools: [['eslint', '--fix']] },
];
diff --git a/.agents/scripts/check/routing.ts b/.agents/scripts/check/routing.ts
index 43df55931cc..31809cbe13f 100644
--- a/.agents/scripts/check/routing.ts
+++ b/.agents/scripts/check/routing.ts
@@ -3,10 +3,8 @@ import path from 'node:path';
import type { PipelineEntry, RepoMount } from './types';
/**
- * stylelint's CSS-in-JS parser mangles ordinary template literals in files it
- * was never configured for (it corrupted this very script once): the repos
- * scope stylelint to `{src,tests}/**` in their `lint:style` scripts, so apply
- * the same boundary here instead of lint-staged's blanket `*.{ts,tsx}` glob.
+ * The repos scope stylelint to `{src,tests}/**` in their `lint:style` scripts,
+ * so apply the same boundary here instead of lint-staged's blanket CSS glob.
*/
export const stylelintApplies = (subPath: string) => /^(?:src|tests)\//.test(subPath);
diff --git a/.agents/skills/source-layout/SKILL.md b/.agents/skills/source-layout/SKILL.md
index 8653d5824be..f161cdb97de 100644
--- a/.agents/skills/source-layout/SKILL.md
+++ b/.agents/skills/source-layout/SKILL.md
@@ -22,7 +22,7 @@ Top-level ownership (`src/features`, `src/routes`, `apps/server/src`, `packages`
A package whose files are already kebab-case (`alint`, `openapi`, `builtin-skills`) keeps kebab-case internally. Shared per-directory modules are `constants.ts`, `types.ts`, `style.ts`, and `utils.ts`, not `const.ts`, `type.ts`, `styles.ts`, or `helpers.ts`. Create one only when two or more modules in that directory use it; a constant or type used by one module stays in that module.
-New files use named exports (`export const PlanCard = …`), even when the neighboring files default-export; do not copy the older default-export habit. The exceptions are modules a framework, tool, or loader imports by their default export: route segments under `src/routes` (see `spa-routes`), Next.js special files (`page.tsx`, `layout.tsx`, `not-found.tsx`), `*.config.ts` files, desktop controllers and services (`*Ctr.ts`, `*Srv.ts`, globbed by `apps/desktop/src/main/core/App.ts`), and locale resource files. Lint does not enforce this: this repository's `eslint.config.mjs` overrides `no-restricted-syntax`, which drops the shared `@lobehub/lint` warning on `export default`. When moving an existing file, keep its exports unchanged so its callers do not change.
+New files use named exports (`export const PlanCard = …`), even when the neighboring files default-export; do not copy the older default-export habit. The exceptions are modules a framework, tool, or loader imports by their default export: route segments under `src/routes` (see `spa-routes`), Next.js special files (`page.tsx`, `layout.tsx`, `not-found.tsx`), `*.config.ts` files, desktop controllers and services (`*Ctr.ts`, `*Srv.ts`, globbed by `apps/desktop/src/main/core/App.ts`), and locale resource files. Lint does not enforce this: this repository's `oxlint.config.mts` turns off `no-restricted-exports`, the shared `@lobehub/oxlint-config` warning on `export default`. When moving an existing file, keep its exports unchanged so its callers do not change.
## 2. Tests
diff --git a/.changelogrc.cjs b/.changelogrc.cjs
index 9a2f5f98d8c..016ffbb827e 100644
--- a/.changelogrc.cjs
+++ b/.changelogrc.cjs
@@ -1 +1 @@
-module.exports = require('@lobehub/lint').changelog;
+module.exports = require('@lobehub/semantic-release-config/changelog');
diff --git a/.releaserc.cjs b/.releaserc.cjs
index d56431b2a03..59c5b585522 100644
--- a/.releaserc.cjs
+++ b/.releaserc.cjs
@@ -1,4 +1,4 @@
-const config = require('@lobehub/lint').semanticRelease;
+const config = require('@lobehub/semantic-release-config').default;
config.branches = [
'main',
diff --git a/.remarkrc.mdx.mjs b/.remarkrc.mdx.mjs
index 16c69026289..4c18568b040 100644
--- a/.remarkrc.mdx.mjs
+++ b/.remarkrc.mdx.mjs
@@ -1,4 +1,4 @@
-import { remarklint } from '@lobehub/lint';
+import remarklint from '@lobehub/remarklint-config';
export default {
...remarklint,
diff --git a/.remarkrc.mjs b/.remarkrc.mjs
index 191e612b06e..3ba4d0b5a6b 100644
--- a/.remarkrc.mjs
+++ b/.remarkrc.mjs
@@ -1,3 +1,3 @@
-import { remarklint } from '@lobehub/lint';
+import remarklint from '@lobehub/remarklint-config';
export default remarklint;
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 7e8823ec4ce..50ab1eb9526 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,8 +1,8 @@
{
"recommendations": [
"Anthropic.claude-code",
- "dbaeumer.vscode-eslint",
"jrr997.antd-docs",
+ "oxc.oxc-vscode",
"seatonjiang.gitmoji-vscode",
"styled-components.vscode-styled-components",
"stylelint.vscode-stylelint",
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 3c4ea86d444..af8ca9e8776 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,25 +1,10 @@
{
"editor.codeActionsOnSave": {
"source.addMissingImports": "explicit",
- "source.fixAll.eslint": "explicit",
+ "source.fixAll.oxc": "explicit",
"source.fixAll.stylelint": "explicit"
},
"editor.formatOnSave": true,
- // don't show errors, but fix when save and git pre commit
- "eslint.rules.customizations": [
- { "rule": "simple-import-sort/exports", "severity": "off" },
- { "rule": "perfectionist/sort-interfaces", "severity": "off" },
- { "rule": "simple-import-sort/imports", "severity": "off" }
- ],
- "eslint.validate": [
- "json",
- "javascript",
- "javascriptreact",
- "typescript",
- "typescriptreact",
- // support mdx
- "mdx"
- ],
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
@@ -55,12 +40,7 @@
"locales/vi-VN/**": true,
"locales/zh-TW/**": true
},
- "stylelint.validate": [
- "css",
- "postcss",
- // make stylelint work with tsx css template strings
- "typescriptreact"
- ],
+ "stylelint.validate": ["css", "less", "postcss"],
"vitest.disableWorkspaceWarning": true,
"workbench.editor.customLabels.patterns": {
"**/app/**/[[]*[]]/[[]*[]]/page.tsx": "${dirname(2)}/${dirname(1)}/${dirname} • page component",
diff --git a/AGENTS.md b/AGENTS.md
index fe147b0e838..b6416fbfc93 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -25,7 +25,7 @@ The `acceptance` skill is generated from the default branch of [lobehub/acceptan
For the full repository map or help locating a code layer, read the `project-overview` skill.
- `apps/server/src`: backend runtime, routers, and services, imported through `@/server/*`. `src/app/(backend)` contains Next.js route shells only; do not put backend business logic there.
-- Server business code reaches Redis through domain methods in `apps/server/src/services/redis` (`redisService.deviceSystemInfo`, `skillTools`, `workspaceRescan`). The service aggregates domains and owns connections, keys, TTL and consistency policy. `apps/server/src/modules/Redis` is only the client/provider layer, not the business service. Add missing business methods to the service and missing transport primitives to the client. Generic cache/claim helpers stay internal to the service boundary. ESLint prevents new direct client access; its explicit legacy migration list only shrinks.
+- Server business code reaches Redis through domain methods in `apps/server/src/services/redis` (`redisService.deviceSystemInfo`, `skillTools`, `workspaceRescan`). The service aggregates domains and owns connections, keys, TTL and consistency policy. `apps/server/src/modules/Redis` is only the client/provider layer, not the business service. Add missing business methods to the service and missing transport primitives to the client. Generic cache/claim helpers stay internal to the service boundary. Oxlint prevents new direct client access; its explicit legacy migration list only shrinks.
- `src/app`: Next.js HTML/auth shells. Web shell helpers belong under `src/libs` or the relevant app segment, not `src/server`.
- `src/spa`: SPA entry points and React Router configuration. `src/routes` holds thin page segments that compose `src/features`; business UI and logic belong in features by domain.
- `src/services` and `src/store`: client API services and Zustand state. Keep fetch/cache guidance in `data-fetching-architecture` and store conventions in `zustand`.
@@ -81,7 +81,7 @@ Use `bun run check [changed-files...]`.
- Run once with the selectors needed: no selector means lint + related tests; `--lint`, `--test`, and `--type` compose. Default scope is all staged, unstaged and untracked changes; explicit paths override it.
- Lint autofixes files: review the emitted diff. Tests use the nearest owning Vitest config. `--type` checks the full repo (`bun run type-check`). Never run `bun run test`, which runs the full suite.
- `bun run type-check` runs Bun's builtin checker (`bun --check --tsconfig-override tsconfig.type-check.json`). That needs Bun ≥ 1.4.3. The package.json `check` script is the agent CLI (`bun run check`).
-- `--alint` is opt-in: model-backed rules in `packages/alint/` for judgement calls eslint cannot express. It needs a provider (`bun run alint:setup`); findings are warnings to fix or justify in the PR.
+- `--alint` is opt-in: model-backed rules in `packages/alint/` for judgement calls a linter cannot express. It needs a provider (`bun run alint:setup`); findings are warnings to fix or justify in the PR.
- For a manual package test, run from the owning package: `cd packages/database && bunx vitest run --silent='passed-only' '[file-path]'`.
### Acceptance
diff --git a/alint.config.toml b/alint.config.toml
index 9bf41a84309..2c822e1b607 100644
--- a/alint.config.toml
+++ b/alint.config.toml
@@ -119,8 +119,8 @@ lobehub = "./packages/alint/rules"
# Browser code, everywhere: no third-party package that needs Node may be
# imported where the SPA (or the Electron renderer) runs it. Node built-ins and
-# server / database aliases are enforced exactly by ESLint (the browser runtime
-# block in eslint.config.mjs); this rule only judges npm packages.
+# server / database aliases are enforced exactly by Oxlint (the browser runtime
+# block in oxlint.config.mts); this rule only judges npm packages.
# `src/app` and `src/libs` are left out on purpose: they mix Next.js shells and
# server helpers (instrumentation, OIDC, MCP) with web code.
[[config.group]]
diff --git a/apps/desktop/.remarkrc.mjs b/apps/desktop/.remarkrc.mjs
index 191e612b06e..3ba4d0b5a6b 100644
--- a/apps/desktop/.remarkrc.mjs
+++ b/apps/desktop/.remarkrc.mjs
@@ -1,3 +1,3 @@
-import { remarklint } from '@lobehub/lint';
+import remarklint from '@lobehub/remarklint-config';
export default remarklint;
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index 38306f0fa15..3960dab1372 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -29,7 +29,7 @@
"lint:circular:main": "dpdm src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
"lint:circular:packages": "dpdm packages/**/src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
"lint:md": "remark . --silent --output",
- "lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
+ "lint:style": "stylelint \"{src,tests}/**/*.{css,less}\" --fix --allow-empty-input",
"lint:ts": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
"log:auth": "node scripts/analyzeAuthLog.mjs",
"package:linux": "npm run build:main && electron-builder --linux --config electron-builder.mjs --publish never",
@@ -43,7 +43,7 @@
"shell:vendor": "node scripts/vendorShellUpdater.mjs",
"start": "npm run build:main && electron .",
"start:reuse": "electron .",
- "stylelint": "stylelint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
+ "stylelint": "stylelint \"src/**/*.{css,less}\" --fix --allow-empty-input",
"test": "vitest --run",
"test:core-ota": "vitest run --config scripts/core-ota-test/vitest.config.mjs",
"type-check": "tsgo --noEmit -p tsconfig.json",
diff --git a/apps/desktop/prettier.config.mjs b/apps/desktop/prettier.config.mjs
index 9e4f773a4e0..d5d02797cdd 100644
--- a/apps/desktop/prettier.config.mjs
+++ b/apps/desktop/prettier.config.mjs
@@ -1,3 +1,3 @@
-import { prettier } from '@lobehub/lint';
+import prettier from '@lobehub/prettier-config';
export default prettier;
diff --git a/apps/desktop/stylelint.config.mjs b/apps/desktop/stylelint.config.mjs
index a903753a965..5bd86b3543f 100644
--- a/apps/desktop/stylelint.config.mjs
+++ b/apps/desktop/stylelint.config.mjs
@@ -1,4 +1,4 @@
-import { stylelint } from '@lobehub/lint';
+import stylelint from '@lobehub/stylelint-config';
export default {
...stylelint,
diff --git a/apps/server/src/globalConfig/genServerAiProviderConfig.ts b/apps/server/src/globalConfig/genServerAiProviderConfig.ts
index 6071e4a1ad2..86c05a22e84 100644
--- a/apps/server/src/globalConfig/genServerAiProviderConfig.ts
+++ b/apps/server/src/globalConfig/genServerAiProviderConfig.ts
@@ -1,6 +1,6 @@
import { type ProviderConfig } from '@lobechat/types';
-import { type AiFullModelCard, type LobeDefaultAiModelListItem, ModelProvider } from 'model-bank';
import * as AiModels from 'model-bank';
+import { type AiFullModelCard, type LobeDefaultAiModelListItem, ModelProvider } from 'model-bank';
import { loadModels } from '@/business/client/model-bank/loadModels';
import { getLLMConfig } from '@/envs/llm';
diff --git a/apps/server/src/modules/Mecha/AgentToolsEngine/index.ts b/apps/server/src/modules/Mecha/AgentToolsEngine/index.ts
index 80b7f0f47d1..d91c39fb1d4 100644
--- a/apps/server/src/modules/Mecha/AgentToolsEngine/index.ts
+++ b/apps/server/src/modules/Mecha/AgentToolsEngine/index.ts
@@ -11,8 +11,7 @@
*/
import { PageAgentIdentifier } from '@lobechat/builtin-tool-page-agent';
import { builtinTools } from '@lobechat/builtin-tools';
-import { createEnableChecker, type LobeToolManifest } from '@lobechat/context-engine';
-import { ToolsEngine } from '@lobechat/context-engine';
+import { createEnableChecker, type LobeToolManifest, ToolsEngine } from '@lobechat/context-engine';
import { assembleManifestPool, resolveToolRules } from '@lobechat/mecha';
import { type RuntimePlatform } from '@lobechat/types';
import debug from 'debug';
diff --git a/apps/server/src/services/bot/BotMessageRouter/index.mockDiscord.db.test.ts b/apps/server/src/services/bot/BotMessageRouter/index.mockDiscord.db.test.ts
index 9aea9df6245..1d83a27b4dd 100644
--- a/apps/server/src/services/bot/BotMessageRouter/index.mockDiscord.db.test.ts
+++ b/apps/server/src/services/bot/BotMessageRouter/index.mockDiscord.db.test.ts
@@ -368,7 +368,7 @@ run('mock Discord gateway + REST drive the real router, bridge and bot-wake pipe
editsOrDeletes: calls.filter(
(call) => /^\/channels\/[^/]+\/messages\/[^/]+$/.test(call.path) && call.method !== 'GET',
),
- messages: calls.filter((call) => call.method === 'POST' && /\/messages$/.test(call.path)),
+ messages: calls.filter((call) => call.method === 'POST' && call.path.endsWith('/messages')),
reactions: calls.filter((call) => /\/reactions\//.test(call.path)),
typing: calls.filter((call) => call.path.endsWith('/typing')),
});
diff --git a/apps/server/src/services/email/impls/nodemailer/index.ts b/apps/server/src/services/email/impls/nodemailer/index.ts
index dfb5deb4513..2311188dbb3 100644
--- a/apps/server/src/services/email/impls/nodemailer/index.ts
+++ b/apps/server/src/services/email/impls/nodemailer/index.ts
@@ -1,7 +1,7 @@
import { TRPCError } from '@trpc/server';
import debug from 'debug';
-import { type Transporter } from 'nodemailer';
import nodemailer from 'nodemailer';
+import { type Transporter } from 'nodemailer';
import { emailEnv } from '@/envs/email';
diff --git a/commitlint.config.mjs b/commitlint.config.mjs
index bef5ef77741..9798565e3e7 100644
--- a/commitlint.config.mjs
+++ b/commitlint.config.mjs
@@ -1,3 +1,3 @@
-import { commitlint } from '@lobehub/lint';
+import commitlint from '@lobehub/commitlint-config';
export default commitlint;
diff --git a/docs/development/basic/contributing-guidelines.mdx b/docs/development/basic/contributing-guidelines.mdx
index 92c801a71c5..b09972e0dcf 100644
--- a/docs/development/basic/contributing-guidelines.mdx
+++ b/docs/development/basic/contributing-guidelines.mdx
@@ -1,8 +1,7 @@
---
title: Code Style and Contribution Guidelines
description: >-
- Learn about LobeHub's code style and contribution process for consistent
- coding.
+ Learn about LobeHub's code style and contribution process for consistent coding.
tags:
- Code Style
- Contribution Guidelines
@@ -17,17 +16,17 @@ Welcome to the Code Style and Contribution Guidelines for LobeHub. This guide wi
## Code Style
-In LobeHub, we use the [@lobehub/lint](https://github.com/lobehub/lobe-lint) package to maintain a unified code style. This package incorporates configurations for `ESLint`, `Prettier`, `remarklint`, and `stylelint` to ensure that our JavaScript, Markdown, and CSS files adhere to the same coding standards.
+In LobeHub, we use the shared configs from [lobe-lint](https://github.com/lobehub/lobe-lint) to maintain a unified code style. They cover `Oxlint`, `Prettier`, `remarklint`, and `stylelint` to ensure that our JavaScript, Markdown, and CSS files adhere to the same coding standards.
-### ESLint
+### Oxlint
-We use ESLint to check for issues in our JavaScript code. You can find the `eslint.config.mjs` flat config file in the project's root directory, which contains our extensions and custom rules for the ESLint configuration of `@lobehub/lint`.
+We use Oxlint to check for issues in our JavaScript and TypeScript code. You can find the `oxlint.config.mts` file in the project's root directory, which contains our extensions and custom rules on top of `@lobehub/oxlint-config`.
-To ensure your code aligns with the project's standards, run ESLint before committing your code.
+To ensure your code aligns with the project's standards, run `bun run lint:ts` before committing your code.
### Prettier
-Prettier is responsible for code formatting to maintain consistency. Our Prettier configuration can be found in `prettier.config.mjs`, imported from `@lobehub/lint`.
+Prettier is responsible for code formatting to maintain consistency. Our Prettier configuration can be found in `prettier.config.mjs`, imported from `@lobehub/prettier-config`.
It's recommended to configure your editor to run Prettier automatically when saving files.
@@ -37,7 +36,7 @@ For Markdown files, we use remarklint to ensure consistent document formatting.
### stylelint
-We utilize stylelint to standardize the style of our CSS code. In the configuration file for stylelint, we have made some custom rule adjustments based on `@lobehub/lint` configuration.
+We utilize stylelint to standardize the style of our CSS and Less files. In the configuration file for stylelint, we have made some custom rule adjustments based on `@lobehub/stylelint-config`. StyleX styles are checked by Oxlint instead.
### Style Checking
diff --git a/docs/development/basic/contributing-guidelines.zh-CN.mdx b/docs/development/basic/contributing-guidelines.zh-CN.mdx
index 2cc2cb961b3..70b0fe44a8e 100644
--- a/docs/development/basic/contributing-guidelines.zh-CN.mdx
+++ b/docs/development/basic/contributing-guidelines.zh-CN.mdx
@@ -15,17 +15,17 @@ tags:
## 代码风格
-在 LobeHub 中,我们使用 [@lobehub/lint](https://github.com/lobehub/lobe-lint) 程序包来统一代码风格。该程序包内置了 `ESLint`、`Prettier`、`remarklint` 和 `stylelint` 的配置,以确保我们的 JavaScript、Markdown 和 CSS 文件遵循相同的编码标准。
+在 LobeHub 中,我们使用 [lobe-lint](https://github.com/lobehub/lobe-lint) 提供的共享配置来统一代码风格。这些配置覆盖 `Oxlint`、`Prettier`、`remarklint` 和 `stylelint`,以确保我们的 JavaScript、Markdown 和 CSS 文件遵循相同的编码标准。
-### ESLint
+### Oxlint
-我们的项目使用 ESLint 来检查 JavaScript 代码中的问题。您可以在项目根目录下找到 `eslint.config.mjs` flat config 文件,其中包含了我们对 `@lobehub/lint` 的 ESLint 配置的扩展和自定义规则。
+我们的项目使用 Oxlint 来检查 JavaScript 和 TypeScript 代码中的问题。您可以在项目根目录下找到 `oxlint.config.mts` 文件,其中包含了我们在 `@lobehub/oxlint-config` 之上的扩展和自定义规则。
-为了与 Next.js 框架兼容,我们在配置中添加了 `plugin:@next/next/recommended`。此外,我们禁用了一些规则,以适应我们项目的特定需求。
+为了与 Next.js 框架兼容,我们在配置中开启了 `next` 选项。此外,我们禁用了一些规则,以适应我们项目的特定需求。
### Prettier
-Prettier 负责代码格式化,以保证代码的一致性。您可以在 `prettier.config.mjs` 中找到我们的 Prettier 配置,它是从 `@lobehub/lint` 导入的。
+Prettier 负责代码格式化,以保证代码的一致性。您可以在 `prettier.config.mjs` 中找到我们的 Prettier 配置,它是从 `@lobehub/prettier-config` 导入的。
在保存文件时,建议您配置您的编辑器以自动运行 Prettier。
@@ -35,7 +35,7 @@ Prettier 负责代码格式化,以保证代码的一致性。您可以在 `pre
### stylelint
-我们使用 stylelint 来规范 CSS 代码的风格。在 `stylelint` 的配置文件中,我们基于 `@lobehub/lint` 的配置进行了一些自定义规则的调整。
+我们使用 stylelint 来规范 CSS 和 Less 文件的风格。在 `stylelint` 的配置文件中,我们基于 `@lobehub/stylelint-config` 进行了一些自定义规则的调整。StyleX 样式由 Oxlint 检查。
### 风格检查
diff --git a/eslint.bundleBoundaries.mjs b/lint.bundleBoundaries.mjs
similarity index 97%
rename from eslint.bundleBoundaries.mjs
rename to lint.bundleBoundaries.mjs
index cd026009356..0ab6b91298c 100644
--- a/eslint.bundleBoundaries.mjs
+++ b/lint.bundleBoundaries.mjs
@@ -1,4 +1,4 @@
-// Bundle-size import boundaries for src/**, shared by eslint.config.mjs. These
+// Bundle-size import boundaries for src/**, shared by oxlint.config.ts. These
// keep real import() seams in place instead of relying on component-level
// conditional rendering.
diff --git a/eslint.config.mjs b/oxlint.config.mts
similarity index 55%
rename from eslint.config.mjs
rename to oxlint.config.mts
index 635313892ea..3ecee4c5f66 100644
--- a/eslint.config.mjs
+++ b/oxlint.config.mts
@@ -1,23 +1,24 @@
import { readFileSync } from 'node:fs';
-import { fileURLToPath } from 'node:url';
-import { eslint } from '@lobehub/lint';
+import { defineConfig, type UserOverride } from '@lobehub/oxlint-config';
import { restrictedImports } from '@lobehub/ui/eslint';
-import { flat as mdxFlat } from 'eslint-plugin-mdx';
import {
browserBundleRestrictedImportPaths,
performanceRestrictedImportPaths,
performanceRestrictedImportPatterns,
-} from './eslint.bundleBoundaries.mjs';
-import { stylexMigrationConfig } from './scripts/stylexMigration/eslint.mjs';
+} from './lint.bundleBoundaries.mjs';
+import { stylexMigrationOverrides } from './scripts/stylexMigration/oxlint.mjs';
-const tsconfigRootDir = fileURLToPath(new URL('.', import.meta.url));
+const [, uiRestrictedImportOptions] = restrictedImports.rules['no-restricted-imports'] as [
+ string,
+ { paths: { message: string; name: string }[]; patterns?: object[] },
+];
const baseRestrictedImportOptions = {
- ...restrictedImports.rules['no-restricted-imports'][1],
+ ...uiRestrictedImportOptions,
patterns: [
- ...(restrictedImports.rules['no-restricted-imports'][1].patterns ?? []),
+ ...(uiRestrictedImportOptions.patterns ?? []),
{
regex: '^@modelcontextprotocol/(?:sdk)(/|$)',
message:
@@ -59,7 +60,7 @@ const shellRouterRestrictedPaths = [
// subpath is Node-only (spawn, rpc, quota-sampler, ...). New entries are
// Node-only until listed there, and the package's runtimeBoundary test keeps
// the listed entries free of Node code.
-const heteroBrowserEntries = JSON.parse(
+const heteroBrowserEntries: string[] = JSON.parse(
readFileSync(
new URL('packages/heterogeneous-agents/browser-entries.json', import.meta.url),
'utf8',
@@ -244,7 +245,17 @@ const legacyRawRedisClientConsumers = [
'apps/server/src/services/understanding/sourceStore.ts',
];
-const createRestrictedImportRule = ({ paths = [], patterns, serverSide = false } = {}) => [
+interface RestrictedImportRuleOptions {
+ paths?: object[];
+ patterns?: object[];
+ serverSide?: boolean;
+}
+
+const createRestrictedImportRule = ({
+ paths = [],
+ patterns,
+ serverSide = false,
+}: RestrictedImportRuleOptions = {}) => [
'error',
{
...baseRestrictedImportOptions,
@@ -306,7 +317,31 @@ const electronIpcRemoveListenerRestrictedSyntax = {
selector: "CallExpression > MemberExpression.callee[property.name='removeListener']",
};
-export default eslint(
+const CORE = ['eslint-core'] satisfies UserOverride['jsPlugins'];
+
+const restrictImports = (
+ files: string[],
+ rule: unknown,
+ excludeFiles?: string[],
+): UserOverride => ({
+ files,
+ ...(excludeFiles && { excludeFiles }),
+ jsPlugins: CORE,
+ rules: { 'eslint-core/no-restricted-imports': rule as never },
+});
+
+const restrictSyntax = (
+ files: string[],
+ selectors: object[],
+ excludeFiles?: string[],
+): UserOverride => ({
+ files,
+ ...(excludeFiles && { excludeFiles }),
+ jsPlugins: CORE,
+ rules: { 'eslint-core/no-restricted-syntax': ['error', ...selectors] as never },
+});
+
+export default defineConfig(
{
ignores: [
// Vendored skill releases; maintained in lobehub/acceptance and lobehub/lobe-design-skill.
@@ -352,8 +387,6 @@ export default eslint(
'.i18nrc.js',
// vendored code (copied from @microsoft/fetch-event-source)
'packages/utils/src/client/fetchEventSource/parse.ts',
- // generated files (regenerate with `bun generate:openapi` in packages/openapi)
- 'packages/openapi/openapi.yml',
// generated files (regenerate with `bun generate` in packages/sdk)
'packages/sdk/src/generated/**',
// generated files (regenerate with `codex app-server generate-ts`)
@@ -361,56 +394,35 @@ export default eslint(
],
next: true,
react: 'next',
+ stylex: true,
},
- {
- languageOptions: {
- parserOptions: {
- tsconfigRootDir,
- },
- },
- },
- {
- ...restrictedImports,
- rules: {
- ...restrictedImports.rules,
- 'no-restricted-imports': ['error', baseRestrictedImportOptions],
- },
- },
+ restrictImports(['**/*'], ['error', baseRestrictedImportOptions]),
// Performance import boundaries. These restrictions preserve real import()
// seams instead of relying on component-level conditional rendering.
- {
- files: ['src/**/*.{ts,tsx}', 'apps/share/src/**/*.{ts,tsx}'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule(),
- },
- },
- {
- // Server-side trees under src/: Next.js shells and route handlers, server
- // helpers, instrumentation and the proxy may import server code.
- files: [
+ restrictImports(
+ ['src/**/*.{ts,tsx}', 'apps/share/src/**/*.{ts,tsx}'],
+ createRestrictedImportRule(),
+ ),
+ // Server-side trees under src/: Next.js shells and route handlers, server
+ // helpers, instrumentation and the proxy may import server code.
+ restrictImports(
+ [
'src/app/**/*.{ts,tsx}',
'src/libs/**/*.{ts,tsx}',
'src/scripts/**/*.{ts,tsx}',
'src/*.{ts,tsx}',
'src/**/*.server.{ts,tsx}',
],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({ serverSide: true }),
- },
- },
- {
- // Bundle-size restrictions target shipped code; tests may reach the barrels.
- files: ['src/**/*.test.{ts,tsx}'],
- rules: {
- 'no-restricted-imports': ['error', baseRestrictedImportOptions],
- },
- },
- {
- // Boot-path trees are statically reachable from the SPA entry. A heavy
- // @lobehub/ui member imported here lands in the first-screen chunk together
- // with shiki / katex / elkjs / emoji data; the CI entry-graph gate catches
- // the regression, this rule explains it at the import site.
- files: [
+ createRestrictedImportRule({ serverSide: true }),
+ ),
+ // Bundle-size restrictions target shipped code; tests may reach the barrels.
+ restrictImports(['src/**/*.test.{ts,tsx}'], ['error', baseRestrictedImportOptions]),
+ // Boot-path trees are statically reachable from the SPA entry. A heavy
+ // @lobehub/ui member imported here lands in the first-screen chunk together
+ // with shiki / katex / elkjs / emoji data; the CI entry-graph gate catches
+ // the regression, this rule explains it at the import site.
+ restrictImports(
+ [
'src/layout/**/*.{ts,tsx}',
'src/spa/**/*.{ts,tsx}',
'src/store/**/*.{ts,tsx}',
@@ -422,135 +434,125 @@ export default eslint(
'src/features/HomeSidebar/**/*.{ts,tsx}',
'src/features/NavPanel/**/*.{ts,tsx}',
],
- ignores: ['src/**/*.test.{ts,tsx}', 'src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- importNames: [
- 'CodeDiff',
- 'CodeEditor',
- 'EmojiPicker',
- 'Highlighter',
- 'HtmlPreview',
- 'Markdown',
- 'Mermaid',
- 'PatchDiff',
- 'Snippet',
- 'SortableList',
- 'SyntaxHighlighter',
- 'SyntaxMermaid',
- ],
- message:
- 'Boot-path modules must not statically import heavy @lobehub/ui members. Load them with lazy(() => import("@lobehub/ui/es/<Member>/index")) or move the consumer into a route tree.',
- name: '@lobehub/ui',
- },
- {
- message:
- 'Boot-path modules must load EmojiPicker with lazy(); it carries the emoji-mart dataset.',
- name: '@/components/EmojiPicker',
- },
- {
- allowTypeImports: true,
- message:
- 'Boot-path modules must not import @lobehub/analytics; it bundles posthog-js. Use "@/libs/analytics/client", which loads it after first paint and queues events.',
- name: '@lobehub/analytics',
- },
- {
- allowTypeImports: true,
- message:
- 'Boot-path modules must not import @lobehub/analytics/react; use useAnalytics from "@/libs/analytics/client".',
- name: '@lobehub/analytics/react',
- },
- ],
- patterns: [
- {
- message:
- 'The builtin tool client barrel exports the whole render registry. Import the dedicated subpath (e.g. "/client/displayControls") or resolve renders lazily.',
- regex: '^@lobechat/builtin-tool-[^/]+/client(?:$|/index$)',
- },
- ],
- }),
- },
- },
- {
- files: ['src/components/Skeleton/**/*.{ts,tsx}'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- name: '@/components/Skeleton',
- message:
- 'Skeleton internals must import sibling components directly to avoid a cycle through their own barrel.',
- },
- {
- name: '@/components/Skeleton/index',
- message:
- 'Skeleton internals must import sibling components directly to avoid a cycle through their own barrel.',
- },
- ],
- }),
- },
- },
- {
- files: ['src/features/Conversation/**/*.{ts,tsx}'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- message:
- 'Conversation internals must use stable subpaths such as "./store", "./ConversationProvider", or "./Messages" instead of the root barrel.',
- name: '@/features/Conversation',
- },
- ],
- }),
- },
- },
- {
- files: ['src/features/NavPanel/**/*.{ts,tsx}'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: shellRouterRestrictedPaths,
- patterns: [
- {
- group: [
- '@/routes/**/_layout/Sidebar',
- '@/routes/**/_layout/Sidebar/**',
- '@/routes/**/_layout/SideBar',
- '@/routes/**/_layout/SideBar/**',
- ],
- message:
- 'NavPanel must not own route Sidebar implementations. Register route content through NavPanelPortal.',
- },
- ],
- }),
- },
- },
- {
- files: [
+ createRestrictedImportRule({
+ paths: [
+ {
+ importNames: [
+ 'CodeDiff',
+ 'CodeEditor',
+ 'EmojiPicker',
+ 'Highlighter',
+ 'HtmlPreview',
+ 'Markdown',
+ 'Mermaid',
+ 'PatchDiff',
+ 'Snippet',
+ 'SortableList',
+ 'SyntaxHighlighter',
+ 'SyntaxMermaid',
+ ],
+ message:
+ 'Boot-path modules must not statically import heavy @lobehub/ui members. Load them with lazy(() => import("@lobehub/ui/es/<Member>/index")) or move the consumer into a route tree.',
+ name: '@lobehub/ui',
+ },
+ {
+ message:
+ 'Boot-path modules must load EmojiPicker with lazy(); it carries the emoji-mart dataset.',
+ name: '@/components/EmojiPicker',
+ },
+ {
+ allowTypeImports: true,
+ message:
+ 'Boot-path modules must not import @lobehub/analytics; it bundles posthog-js. Use "@/libs/analytics/client", which loads it after first paint and queues events.',
+ name: '@lobehub/analytics',
+ },
+ {
+ allowTypeImports: true,
+ message:
+ 'Boot-path modules must not import @lobehub/analytics/react; use useAnalytics from "@/libs/analytics/client".',
+ name: '@lobehub/analytics/react',
+ },
+ ],
+ patterns: [
+ {
+ message:
+ 'The builtin tool client barrel exports the whole render registry. Import the dedicated subpath (e.g. "/client/displayControls") or resolve renders lazily.',
+ regex: '^@lobechat/builtin-tool-[^/]+/client(?:$|/index$)',
+ },
+ ],
+ }),
+ ['src/**/*.test.{ts,tsx}', 'src/layout/AuthProvider/MarketAuth/ProfileSetupModal.tsx'],
+ ),
+ restrictImports(
+ ['src/components/Skeleton/**/*.{ts,tsx}'],
+ createRestrictedImportRule({
+ paths: [
+ {
+ name: '@/components/Skeleton',
+ message:
+ 'Skeleton internals must import sibling components directly to avoid a cycle through their own barrel.',
+ },
+ {
+ name: '@/components/Skeleton/index',
+ message:
+ 'Skeleton internals must import sibling components directly to avoid a cycle through their own barrel.',
+ },
+ ],
+ }),
+ ),
+ restrictImports(
+ ['src/features/Conversation/**/*.{ts,tsx}'],
+ createRestrictedImportRule({
+ paths: [
+ {
+ message:
+ 'Conversation internals must use stable subpaths such as "./store", "./ConversationProvider", or "./Messages" instead of the root barrel.',
+ name: '@/features/Conversation',
+ },
+ ],
+ }),
+ ),
+ restrictImports(
+ ['src/features/NavPanel/**/*.{ts,tsx}'],
+ createRestrictedImportRule({
+ paths: shellRouterRestrictedPaths,
+ patterns: [
+ {
+ group: [
+ '@/routes/**/_layout/Sidebar',
+ '@/routes/**/_layout/Sidebar/**',
+ '@/routes/**/_layout/SideBar',
+ '@/routes/**/_layout/SideBar/**',
+ ],
+ message:
+ 'NavPanel must not own route Sidebar implementations. Register route content through NavPanelPortal.',
+ },
+ ],
+ }),
+ ),
+ restrictImports(
+ [
'src/routes/**/_layout/Sidebar.{ts,tsx}',
'src/routes/**/_layout/Sidebar/**/*.{ts,tsx}',
'src/routes/**/_layout/SideBar.{ts,tsx}',
'src/routes/**/_layout/SideBar/**/*.{ts,tsx}',
],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- message:
- 'Route Sidebars must import NavPanelPortal from its dedicated subpath instead of the NavPanel host barrel.',
- name: '@/features/NavPanel',
- },
- ...shellRouterRestrictedPaths,
- ],
- }),
- },
- },
- {
- // Sidebar/titlebar/command-menu trees the desktop shell renders outside TabHost.
- // GenerationLayout is split deliberately: Body and Header are portal'd into the
- // sidebar, while the layout root stays in the route tree and owns the url sync.
- files: [
+ createRestrictedImportRule({
+ paths: [
+ {
+ message:
+ 'Route Sidebars must import NavPanelPortal from its dedicated subpath instead of the NavPanel host barrel.',
+ name: '@/features/NavPanel',
+ },
+ ...shellRouterRestrictedPaths,
+ ],
+ }),
+ ),
+ // Sidebar/titlebar/command-menu trees the desktop shell renders outside TabHost.
+ // GenerationLayout is split deliberately: Body and Header are portal'd into the
+ // sidebar, while the layout root stays in the route tree and owns the url sync.
+ restrictImports(
+ [
'src/features/AgentSidebar/**/*.{ts,tsx}',
'src/features/CommandMenu/**/*.{ts,tsx}',
'src/features/Electron/titlebar/**/*.{ts,tsx}',
@@ -560,279 +562,237 @@ export default eslint(
'src/routes/(main)/(create)/features/GenerationLayout/Body/**/*.{ts,tsx}',
'src/routes/(main)/(create)/features/GenerationLayout/Header/**/*.{ts,tsx}',
],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: shellRouterRestrictedPaths,
- }),
- },
- },
- {
- files: ['src/features/HomeInbox/**/*.{ts,tsx}'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- message:
- 'Load RunReplyEditor with import() after reply intent so the editor stays outside the home static closure.',
- name: '@/features/AgentTasks/AgentTaskDetail/RunReplyEditor',
- },
- {
- message:
- 'HomeInbox must not mount TopicChatDrawer; navigate to the topic or load an interaction-owned surface dynamically.',
- name: '@/features/AgentTasks/AgentTaskDetail/TopicChatDrawer',
- },
- {
- message:
- 'HomeInbox must not mount TopicChatDrawer; navigate to the topic or load an interaction-owned surface dynamically.',
- name: '@/features/AgentTasks/AgentTaskDetail/TopicChatDrawer/index',
- },
- {
- message:
- 'Use the imperative DocumentModal loader instead of statically importing the implementation.',
- name: '@/features/DocumentModal',
- },
- {
- message:
- 'Use the imperative DocumentModal loader instead of statically importing the implementation.',
- name: '@/features/DocumentModal/index',
- },
- ],
- }),
- },
- },
- {
- files: [
+ createRestrictedImportRule({ paths: shellRouterRestrictedPaths }),
+ ),
+ restrictImports(
+ ['src/features/HomeInbox/**/*.{ts,tsx}'],
+ createRestrictedImportRule({
+ paths: [
+ {
+ message:
+ 'Load RunReplyEditor with import() after reply intent so the editor stays outside the home static closure.',
+ name: '@/features/AgentTasks/AgentTaskDetail/RunReplyEditor',
+ },
+ {
+ message:
+ 'HomeInbox must not mount TopicChatDrawer; navigate to the topic or load an interaction-owned surface dynamically.',
+ name: '@/features/AgentTasks/AgentTaskDetail/TopicChatDrawer',
+ },
+ {
+ message:
+ 'HomeInbox must not mount TopicChatDrawer; navigate to the topic or load an interaction-owned surface dynamically.',
+ name: '@/features/AgentTasks/AgentTaskDetail/TopicChatDrawer/index',
+ },
+ {
+ message:
+ 'Use the imperative DocumentModal loader instead of statically importing the implementation.',
+ name: '@/features/DocumentModal',
+ },
+ {
+ message:
+ 'Use the imperative DocumentModal loader instead of statically importing the implementation.',
+ name: '@/features/DocumentModal/index',
+ },
+ ],
+ }),
+ ),
+ restrictImports(
+ [
'src/features/Home/**/*.{ts,tsx}',
'src/features/HomeLayout/**/*.{ts,tsx}',
'src/routes/(main)/home/**/*.{ts,tsx}',
],
- ignores: ['src/features/Home/InputArea/EditorInput.tsx'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- message:
- 'Home cold-path modules must use stable Conversation subpaths instead of the root barrel that exports ChatInput.',
- name: '@/features/Conversation',
- },
- ],
- patterns: [
- {
- message:
- 'Home cold-path modules must not statically import ChatInput. Load an isolated editor entry with import().',
- // `hooks/useAgentModelSelection` reaches the store only through the
- // editor-free `store/apiContext`; Home model switches share its path.
- regex:
- '^@/features/ChatInput(?:$|/(?!(?:hooks/useAgentModelSelection|store/initialState|utils/contextSelections)$).+)',
- },
- ],
- }),
- },
- },
- {
- // The home sidebar tree carries both sets of constraints: it is a shell tree
- // rendered outside TabHost, and it is also a home cold path. Flat config
- // replaces `no-restricted-imports` rather than merging it, so the shell paths
- // have to be repeated here instead of relying on the shell block above.
- files: ['src/features/HomeSidebar/**/*.{ts,tsx}'],
- ignores: ['src/features/HomeSidebar/hooks/useCreateModal.tsx'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- message:
- 'Home cold-path modules must use stable Conversation subpaths instead of the root barrel that exports ChatInput.',
- name: '@/features/Conversation',
- },
- ...shellRouterRestrictedPaths,
- ],
- patterns: [
- {
- message:
- 'Home cold-path modules must not statically import ChatInput. Load an isolated editor entry with import().',
- regex:
- '^@/features/ChatInput(?:$|/(?!(?:store/initialState|utils/contextSelections)$).+)',
- },
- ],
- }),
- },
- },
- {
- files: ['src/features/Home/InputArea/index.tsx'],
- rules: {
- 'no-restricted-imports': createRestrictedImportRule({
- paths: [
- {
- message:
- 'The home input must load EditorInput through useProgressiveEditor instead of adding it to the route static closure.',
- name: './EditorInput',
- },
- ],
- }),
- },
- },
+ createRestrictedImportRule({
+ paths: [
+ {
+ message:
+ 'Home cold-path modules must use stable Conversation subpaths instead of the root barrel that exports ChatInput.',
+ name: '@/features/Conversation',
+ },
+ ],
+ patterns: [
+ {
+ message:
+ 'Home cold-path modules must not statically import ChatInput. Load an isolated editor entry with import().',
+ // `hooks/useAgentModelSelection` reaches the store only through the
+ // editor-free `store/apiContext`; Home model switches share its path.
+ regex:
+ '^@/features/ChatInput(?:$|/(?!(?:hooks/useAgentModelSelection|store/initialState|utils/contextSelections)$).+)',
+ },
+ ],
+ }),
+ ['src/features/Home/InputArea/EditorInput.tsx'],
+ ),
+ // The home sidebar tree carries both sets of constraints: it is a shell tree
+ // rendered outside TabHost, and it is also a home cold path. A later override
+ // replaces `eslint-core/no-restricted-imports` rather than merging it, so the
+ // shell paths have to be repeated here instead of relying on the shell block above.
+ restrictImports(
+ ['src/features/HomeSidebar/**/*.{ts,tsx}'],
+ createRestrictedImportRule({
+ paths: [
+ {
+ message:
+ 'Home cold-path modules must use stable Conversation subpaths instead of the root barrel that exports ChatInput.',
+ name: '@/features/Conversation',
+ },
+ ...shellRouterRestrictedPaths,
+ ],
+ patterns: [
+ {
+ message:
+ 'Home cold-path modules must not statically import ChatInput. Load an isolated editor entry with import().',
+ regex:
+ '^@/features/ChatInput(?:$|/(?!(?:store/initialState|utils/contextSelections)$).+)',
+ },
+ ],
+ }),
+ ['src/features/HomeSidebar/hooks/useCreateModal.tsx'],
+ ),
+ restrictImports(
+ ['src/features/Home/InputArea/index.tsx'],
+ createRestrictedImportRule({
+ paths: [
+ {
+ message:
+ 'The home input must load EditorInput through useProgressiveEditor instead of adding it to the route static closure.',
+ name: './EditorInput',
+ },
+ ],
+ }),
+ ),
// Global rule overrides
{
+ files: ['**/*'],
rules: {
- '@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 0,
- '@eslint-react/jsx-key-before-spread': 0,
- '@eslint-react/naming-convention/ref-name': 0,
- '@eslint-react/naming-convention/use-state': 0,
- '@eslint-react/no-array-index-key': 0,
- '@next/next/no-img-element': 0,
- '@typescript-eslint/no-use-before-define': 0,
- '@typescript-eslint/no-useless-constructor': 0,
- 'no-extra-boolean-cast': 0,
- 'no-restricted-syntax': 0,
- 'react-refresh/only-export-components': 0,
- 'react/no-unknown-property': 0,
- 'regexp/match-any': 0,
- 'unicorn/better-regex': 0,
+ '@eslint-react/jsx-no-key-after-spread': 'off',
+ '@eslint-react/naming-convention-ref-name': 'off',
+ '@eslint-react/no-array-index-key': 'off',
+ '@eslint-react/set-state-in-effect': 'off',
+ '@eslint-react/use-state': 'off',
+ // There is no Pages Router: ESLint's version only checked pages/ and never fired,
+ // while Oxlint's reports every root-relative <a href>.
+ 'nextjs/no-html-link-for-pages': 'off',
+ 'nextjs/no-img-element': 'off',
+ 'no-extra-boolean-cast': 'off',
+ // Default exports are allowed here; the preset bans them through this rule.
+ 'no-restricted-exports': 'off',
+ 'no-use-before-define': 'off',
+ 'no-useless-constructor': 'off',
+ 'react/no-unknown-property': 'off',
+ 'react/only-export-components': 'off',
// conflicts with prettier, which lowercases hex literals
- 'unicorn/number-literal-case': 0,
+ 'unicorn/number-literal-case': 'off',
},
},
// TypeScript files - enforce consistent type imports
{
files: ['**/*.{ts,tsx}'],
rules: {
- '@typescript-eslint/consistent-type-imports': [
- 2,
- {
- fixStyle: 'separate-type-imports',
- },
- ],
- 'no-restricted-syntax': [
- 'error',
- ...useRefLazyInitRestrictedSyntax,
- ...uppercaseRestrictedSyntax,
- ],
- },
- },
- {
- files: ['apps/server/src/**/*.{ts,tsx}'],
- rules: {
- 'no-restricted-imports': [
- 'error',
- {
- ...baseRestrictedImportOptions,
- paths: [...(baseRestrictedImportOptions.paths ?? []), ...serverI18nRestrictedImportPaths],
- patterns: [
- ...(baseRestrictedImportOptions.patterns ?? []),
- ...serverI18nRestrictedImportPatterns,
- ],
- },
- ],
+ 'typescript/consistent-type-imports': ['error', { fixStyle: 'separate-type-imports' }],
},
},
- {
- // Redis access boundary for server code (see `redisAccessRestrictedImportPaths`).
- files: ['apps/server/src/**/*.{ts,tsx}'],
- // Tests of the legacy consumers import the raw module to mock or seed it;
- // the boundary is about production code paths.
- ignores: [
+ restrictSyntax(
+ ['**/*.{ts,tsx}'],
+ [...useRefLazyInitRestrictedSyntax, ...uppercaseRestrictedSyntax],
+ ),
+ restrictImports(
+ ['apps/server/src/**/*.{ts,tsx}'],
+ [
+ 'error',
+ {
+ ...baseRestrictedImportOptions,
+ paths: [...(baseRestrictedImportOptions.paths ?? []), ...serverI18nRestrictedImportPaths],
+ patterns: [
+ ...(baseRestrictedImportOptions.patterns ?? []),
+ ...serverI18nRestrictedImportPatterns,
+ ],
+ },
+ ],
+ ),
+ // Redis access boundary for server code (see `redisAccessRestrictedImportPaths`).
+ // Tests of the legacy consumers import the raw module to mock or seed it;
+ // the boundary is about production code paths.
+ ...(() => {
+ const files = ['apps/server/src/**/*.{ts,tsx}'];
+ const excludeFiles = [
...legacyRawRedisClientConsumers,
'apps/server/src/services/redis/**',
'apps/server/src/modules/Redis/**',
'**/*.test.{ts,tsx}',
'**/__tests__/**',
- ],
- rules: {
- 'no-restricted-imports': [
- 'error',
- {
- ...baseRestrictedImportOptions,
- paths: [
- ...(baseRestrictedImportOptions.paths ?? []),
- ...serverI18nRestrictedImportPaths,
- ...redisAccessRestrictedImportPaths,
- ],
- patterns: [
- ...(baseRestrictedImportOptions.patterns ?? []),
- ...serverI18nRestrictedImportPatterns,
- {
- group: ['@/server/modules/Redis/*'],
- message: 'Use domain methods in services/redis.',
- },
- ],
- },
- ],
- 'no-restricted-syntax': [
- 'error',
- ...useRefLazyInitRestrictedSyntax,
- ...uppercaseRestrictedSyntax,
- ...redisAccessRestrictedSyntax,
- ],
- },
- },
- {
- files: [
+ ];
+ return [
+ restrictImports(
+ files,
+ [
+ 'error',
+ {
+ ...baseRestrictedImportOptions,
+ paths: [
+ ...(baseRestrictedImportOptions.paths ?? []),
+ ...serverI18nRestrictedImportPaths,
+ ...redisAccessRestrictedImportPaths,
+ ],
+ patterns: [
+ ...(baseRestrictedImportOptions.patterns ?? []),
+ ...serverI18nRestrictedImportPatterns,
+ {
+ group: ['@/server/modules/Redis/*'],
+ message: 'Use domain methods in services/redis.',
+ },
+ ],
+ },
+ ],
+ excludeFiles,
+ ),
+ restrictSyntax(
+ files,
+ [
+ ...useRefLazyInitRestrictedSyntax,
+ ...uppercaseRestrictedSyntax,
+ ...redisAccessRestrictedSyntax,
+ ],
+ excludeFiles,
+ ),
+ ];
+ })(),
+ restrictSyntax(
+ [
'apps/desktop/src/overlay/**/*.{ts,tsx}',
'packages/electron-client-ipc/src/**/*.{ts,tsx}',
'src/**/*.{ts,tsx}',
],
- ignores: ['src/hooks/usePWAInstall.ts'],
- rules: {
- 'no-restricted-syntax': [
- 'error',
- ...useRefLazyInitRestrictedSyntax,
- ...uppercaseRestrictedSyntax,
- electronIpcRemoveListenerRestrictedSyntax,
- ],
- },
- },
- // MDX files
- {
- ...mdxFlat,
- files: ['**/*.mdx'],
- rules: {
- ...mdxFlat.rules,
- '@typescript-eslint/consistent-type-imports': 0,
- '@typescript-eslint/no-unused-vars': 1,
- 'mdx/remark': 0,
- 'no-undef': 0,
- 'react/jsx-no-undef': 0,
- 'react/no-unescaped-entities': 0,
- },
- },
+ [
+ ...useRefLazyInitRestrictedSyntax,
+ ...uppercaseRestrictedSyntax,
+ electronIpcRemoveListenerRestrictedSyntax,
+ ],
+ ['src/hooks/usePWAInstall.ts'],
+ ),
// Store/image and types/generation - disable sorting
{
files: ['src/store/image/**/*', 'src/types/generation/**/*'],
rules: {
- 'perfectionist/sort-interfaces': 0,
- 'perfectionist/sort-object-types': 0,
- 'perfectionist/sort-objects': 0,
+ 'perfectionist/sort-interfaces': 'off',
},
},
// model-bank aiModels - enforce English-only descriptions
- {
- files: ['packages/model-bank/src/aiModels/**/*'],
- rules: {
- 'no-restricted-syntax': [
- 'error',
- ...useRefLazyInitRestrictedSyntax,
- ...uppercaseRestrictedSyntax,
- {
- message: 'Chinese characters are not allowed in aiModels files. Use English instead.',
- selector: 'Literal[value=/[\\u4e00-\\u9fff]/]',
- },
- ],
- },
- },
- // CLI scripts
- {
- files: ['scripts/**/*'],
- rules: {
- 'unicorn/no-process-exit': 0,
- 'unicorn/prefer-top-level-await': 0,
- },
- },
+ restrictSyntax(
+ ['packages/model-bank/src/aiModels/**/*'],
+ [
+ ...useRefLazyInitRestrictedSyntax,
+ ...uppercaseRestrictedSyntax,
+ {
+ message: 'Chinese characters are not allowed in aiModels files. Use English instead.',
+ selector: 'Literal[value=/[\\u4e00-\\u9fff]/]',
+ },
+ ],
+ ),
// E2E and test files - allow console.log for debugging
{
files: ['e2e/**/*', '**/*.test.ts', '**/*.test.tsx'],
- rules: {
- 'no-console': 0,
- },
+ rules: { 'no-console': 'off' },
},
// CLIs and debug utilities - console output is the primary interface
{
@@ -841,9 +801,7 @@ export default eslint(
'apps/cli/**/*',
'packages/model-runtime/src/utils/debugStream.ts',
],
- rules: {
- 'no-console': 0,
- },
+ rules: { 'no-console': 'off' },
},
// Business stubs - keep `use`-prefixed APIs mirroring the cloud implementation,
// even when the OSS fallback doesn't call any hooks
@@ -856,16 +814,12 @@ export default eslint(
'src/business/client/hooks/useRenderBusinessChatErrorMessageExtra.tsx',
'src/business/client/hooks/useRenderBusinessVideoBatchItem.tsx',
],
- rules: {
- '@eslint-react/no-unnecessary-use-prefix': 0,
- },
+ rules: { '@eslint-react/no-unnecessary-use-prefix': 'off' },
},
- ...stylexMigrationConfig,
+ ...(stylexMigrationOverrides as UserOverride[]),
// CommonJS files rely on `require()` by design
{
files: ['**/*.cjs', 'apps/desktop/shell/**/*.js'],
- rules: {
- '@typescript-eslint/no-require-imports': 0,
- },
+ rules: { 'typescript/no-require-imports': 'off' },
},
);
diff --git a/package.json b/package.json
index 32c0db557e0..9c98a8556ba 100644
--- a/package.json
+++ b/package.json
@@ -107,9 +107,9 @@
"lint:circular:packages": "dpdm packages/**/src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
"lint:console": "tsx scripts/checkConsoleLog.mts",
"lint:md": "remark . --silent --output",
- "lint:mdx": "npm run workflow:mdx && remark \"docs/**/*.mdx\" -r ./.remarkrc.mdx.mjs --silent --output && eslint \"docs/**/*.mdx\" --quiet --fix",
- "lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
- "lint:ts": "eslint src/ tests/ apps/server/src/ --concurrency=auto",
+ "lint:mdx": "npm run workflow:mdx && remark \"docs/**/*.mdx\" -r ./.remarkrc.mdx.mjs --silent --output",
+ "lint:style": "stylelint \"{src,tests}/**/*.{css,less}\" --fix --allow-empty-input",
+ "lint:ts": "oxlint src/ tests/ apps/server/src/",
"lint:unused": "knip --include files,exports,types,enumMembers,duplicates",
"prepare": "git rev-parse --git-dir > /dev/null 2>&1 && git config core.hooksPath .githooks || true",
"prettier": "prettier -c --write \"**/**\"",
@@ -123,7 +123,7 @@
"self-hosting:docker": "docker build -t lobehub:local .",
"self-hosting:docker-cn": "docker build -t lobehub-local --build-arg USE_CN_MIRROR=true .",
"start": "next start -p 3210",
- "stylelint": "stylelint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
+ "stylelint": "stylelint \"src/**/*.{css,less}\" --fix --allow-empty-input",
"stylex:migration": "tsx scripts/stylexMigration/index.ts",
"stylex:verify": "bun scripts/stylexMigration/verification/run.ts",
"stylex:verify:test": "vitest run --config scripts/stylexMigration/verification/vitest.config.ts --silent='passed-only'",
@@ -159,28 +159,26 @@
"prettier --write --no-error-on-unmatched-pattern"
],
"*.mdx": [
- "remark -r ./.remarkrc.mdx.mjs --silent --output --",
- "eslint --quiet --fix"
+ "remark -r ./.remarkrc.mdx.mjs --silent --output --"
],
"*.json": [
"prettier --write --no-error-on-unmatched-pattern"
],
"*.{mjs,cjs}": [
- "eslint --fix",
+ "oxlint --fix",
"prettier --write"
],
"*.{js,jsx}": [
- "eslint --fix",
- "stylelint --fix",
+ "oxlint --fix",
"prettier --write"
],
"*.{ts,tsx}": [
- "stylelint --fix",
- "eslint --fix",
+ "oxlint --fix",
"prettier --parser=typescript --write"
],
- "*.{yml,yaml}": [
- "eslint --fix"
+ "*.{css,less}": [
+ "stylelint --fix",
+ "prettier --write"
]
},
"overrides": {
@@ -510,17 +508,21 @@
"@inquirer/prompts": "^8.5.2",
"@lobechat/agent-tracing": "workspace:*",
"@lobechat/types": "workspace:*",
+ "@lobehub/commitlint-config": "^3.0.0",
"@lobehub/i18n-cli": "^1.27.0",
- "@lobehub/lint": "2.1.5",
"@lobehub/market-types": "^1.19.0",
+ "@lobehub/oxlint-config": "^3.0.0",
+ "@lobehub/prettier-config": "^3.0.0",
+ "@lobehub/remarklint-config": "^3.0.0",
+ "@lobehub/semantic-release-config": "^3.0.0",
"@lobehub/seo-cli": "^1.7.0",
+ "@lobehub/stylelint-config": "^3.0.0",
"@modelcontextprotocol/server": "~2.4.0",
"@peculiar/webcrypto": "^1.7.1",
"@playwright/test": "^1.62.1",
"@prettier/sync": "^0.6.1",
"@rolldown/plugin-transform-imports": "0.1.1",
"@semantic-release/exec": "^6.0.3",
- "@stylexjs/eslint-plugin": "0.19.1",
"@stylexjs/unplugin": "0.19.1",
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
@@ -569,8 +571,6 @@
"drizzle-dbml-generator": "^0.10.0",
"drizzle-kit": "^0.31.10",
"esbuild": "^0.28.2",
- "eslint": "10.0.2",
- "eslint-plugin-mdx": "^3.8.1",
"fake-indexeddb": "^6.2.5",
"fs-extra": "^11.4.0",
"glob": "^13.0.6",
@@ -586,6 +586,7 @@
"node-fetch": "^3.3.2",
"node-gyp": "^12.4.0",
"openapi-typescript": "^7.13.0",
+ "oxlint": "1.90.0",
"p-map": "^7.0.6",
"postcss": "8.5.23",
"postcss-selector-parser": "7.1.7",
diff --git a/packages/alint/README.md b/packages/alint/README.md
index 6aad94c106c..6033e2b6e6d 100644
--- a/packages/alint/README.md
+++ b/packages/alint/README.md
@@ -45,7 +45,7 @@ Package-level rules, kept next to the package they describe:
`error` is reserved for rules measured at zero false positives on real PRs; an error turns the ALint check red. A rule starts at `warn` and is promoted only after its findings have been read on real PRs. A rule whose findings are mostly true but not worth acting on per PR does not belong here: `test-the-exit-not-the-entry` was removed after five days because it produced 92% of all findings and drowned out the rest.
-**What belongs here, and what belongs in ESLint.** A check that an AST or a path list decides — an import path, a banned call, a naming pattern — goes into ESLint, where it is exact, free and runs in the editor. alint takes only what needs judgement: whether a list is runtime-sized, whether a table is another aggregate, whether an effect reads the server. Leaving a deterministic check to a model buys false positives: `no-node-in-browser` once flagged 34 imports on canary and 33 were type-only or browser-safe, while the same boundary written as `no-restricted-imports` (the browser runtime block in `eslint.config.mjs`) found exactly the one real violation. The model also emits findings whose own message concludes "no violation"; a prompt does not reliably suppress that, so every rule states its carve-outs as "return no finding".
+**What belongs here, and what belongs in ESLint.** A check that an AST or a path list decides — an import path, a banned call, a naming pattern — goes into Oxlint, where it is exact, free and runs in the editor. alint takes only what needs judgement: whether a list is runtime-sized, whether a table is another aggregate, whether an effect reads the server. Leaving a deterministic check to a model buys false positives: `no-node-in-browser` once flagged 34 imports on canary and 33 were type-only or browser-safe, while the same boundary written as `no-restricted-imports` (the browser runtime block in `oxlint.config.mts`) found exactly the one real violation. The model also emits findings whose own message concludes "no violation"; a prompt does not reliably suppress that, so every rule states its carve-outs as "return no finding".
Scopes are declared as `[[config.group]]` entries in the root `alint.config.toml`. Never scope a rule with `includeFiles` inside `rule.alint.toml`: it only filters reports, so every file still runs (double the jobs), and it marks the rule uncacheable.
diff --git a/packages/alint/rules/no-node-in-browser/rule.alint.toml b/packages/alint/rules/no-node-in-browser/rule.alint.toml
index aef6d454f24..a6564be8be3 100644
--- a/packages/alint/rules/no-node-in-browser/rule.alint.toml
+++ b/packages/alint/rules/no-node-in-browser/rule.alint.toml
@@ -5,7 +5,7 @@ You are reviewing one TypeScript file from LobeHub's web client: the Vite SPA un
Team rule: code that runs in the browser must not import anything that only exists in Node. The Electron renderer is browser code too — it reaches Node only through IPC.
-ESLint already enforces the deterministic part of this rule (`no-restricted-imports` in eslint.config.mjs): Node built-ins, `@/server/*`, `@/app/(backend)/*`, database models / repositories / clients, and the Node-only subpaths of `@lobechat/heterogeneous-agents`. Do NOT report any of those; they are not your job here.
+Oxlint already enforces the deterministic part of this rule (`eslint-core/no-restricted-imports` in oxlint.config.mts): Node built-ins, `@/server/*`, `@/app/(backend)/*`, database models / repositories / clients, and the Node-only subpaths of `@lobechat/heterogeneous-agents`. Do NOT report any of those; they are not your job here.
Your job is the part a path list cannot decide: a THIRD-PARTY npm package whose runtime needs Node, imported as a value. Typical examples: database drivers and ORMs' Node adapters (`pg`, `postgres`, `@neondatabase/serverless` pools, `drizzle-orm/node-postgres`), `ioredis`, `sharp`, `simple-git`, `execa`, `node-pty`, `chokidar`, `electron` main-process APIs (`app`, `BrowserWindow`, `ipcMain`), `server-only`, SDKs documented as Node-only or that read files, spawn processes or open raw sockets.
diff --git a/prettier.config.mjs b/prettier.config.mjs
index 28c65bd9591..507f5a4ff04 100644
--- a/prettier.config.mjs
+++ b/prettier.config.mjs
@@ -1,4 +1,4 @@
-import { prettier } from '@lobehub/lint';
+import prettier from '@lobehub/prettier-config';
export default {
...prettier,
diff --git a/scripts/stylexMigration/codemod/index.ts b/scripts/stylexMigration/codemod/index.ts
index f740101c05b..10d2a288d77 100644
--- a/scripts/stylexMigration/codemod/index.ts
+++ b/scripts/stylexMigration/codemod/index.ts
@@ -88,7 +88,7 @@ export const runCodemod = async (
compileStylex(code, filePath);
const linted = await lintAndFix(await format(code, filePath), filePath);
if (linted.errors.length > 0) throw new UnsupportedCssError(`lint: ${linted.errors[0]}`);
- // eslint --fix merges duplicate imports without formatting them.
+ // oxlint --fix merges duplicate imports without formatting them.
if (write) writeFileSync(filePath, await format(linted.code, filePath));
report.converted.push(file);
if (mergesOutsideClassName > 0) report.review.push(file);
diff --git a/scripts/stylexMigration/codemod/validate.ts b/scripts/stylexMigration/codemod/validate.ts
index 2c88f3dc9c9..4478d665e8f 100644
--- a/scripts/stylexMigration/codemod/validate.ts
+++ b/scripts/stylexMigration/codemod/validate.ts
@@ -1,8 +1,8 @@
-import { realpathSync } from 'node:fs';
+import { spawnSync } from 'node:child_process';
+import { readFileSync, realpathSync, writeFileSync } from 'node:fs';
import { createRequire } from 'node:module';
import path from 'node:path';
-import { ESLint } from 'eslint';
import * as prettier from 'prettier';
type Babel = {
@@ -23,7 +23,7 @@ const loadCompiler = () => {
};
let compiler: ReturnType<typeof loadCompiler> | undefined;
-let eslint: ESLint | undefined;
+const oxlintBin = path.join(repoRoot, 'node_modules/.bin/oxlint');
/** Throws when the StyleX compiler rejects the file. */
export const compileStylex = (code: string, filename: string) => {
@@ -55,12 +55,28 @@ export const format = async (code: string, filePath: string) => {
return prettier.format(code, { ...config, filepath: filePath });
};
-/** Lints with autofix; returns the fixed code and every remaining error. */
+/**
+ * Lints with autofix; returns the fixed code and every remaining error. Oxlint
+ * has no stdin mode and resolves path-scoped overrides from the file path, so
+ * the code is linted in place and the original file is restored afterwards.
+ */
export const lintAndFix = async (code: string, filePath: string) => {
- eslint ??= new ESLint({ cwd: repoRoot, fix: true });
- const [result] = await eslint.lintText(code, { filePath });
- const errors = result.messages
- .filter((m) => m.severity === 2)
- .map((m) => `${m.ruleId ?? 'parse'}: ${m.message.split('\n')[0]}`);
- return { code: result.output ?? code, errors };
+ const original = readFileSync(filePath, 'utf8');
+ writeFileSync(filePath, code);
+ try {
+ const { stdout } = spawnSync(oxlintBin, ['--fix', '--format', 'json', filePath], {
+ cwd: repoRoot,
+ encoding: 'utf8',
+ maxBuffer: 64 * 1024 * 1024,
+ });
+ const { diagnostics } = JSON.parse(stdout) as {
+ diagnostics: { code?: string; message: string; severity: string }[];
+ };
+ const errors = diagnostics
+ .filter((d) => d.severity === 'error')
+ .map((d) => `${d.code ?? 'parse'}: ${d.message.split('\n')[0]}`);
+ return { code: readFileSync(filePath, 'utf8'), errors };
+ } finally {
+ writeFileSync(filePath, original);
+ }
};
diff --git a/scripts/stylexMigration/eslint.test.ts b/scripts/stylexMigration/eslint.test.ts
deleted file mode 100644
index b5c7bb236bf..00000000000
--- a/scripts/stylexMigration/eslint.test.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-// @vitest-environment node
-import path from 'node:path';
-
-import { ESLint } from 'eslint';
-import { describe, expect, it } from 'vitest';
-
-import { readLegacyFiles } from '.';
-
-const repoRoot = path.resolve(import.meta.dirname, '../..');
-const rule = 'stylex-migration/no-emotion-styles';
-
-const ruleFor = async (eslint: ESLint, file: string) => {
- const config: { rules?: Record<string, unknown> } | undefined =
- await eslint.calculateConfigForFile(path.join(repoRoot, file));
- // undefined for files ESLint ignores globally
- return config?.rules?.[rule];
-};
-
-describe('stylex-migration/no-emotion-styles config', () => {
- const eslint = new ESLint({ cwd: repoRoot });
-
- it('exempts every legacy file, including route segments read as glob syntax', async () => {
- const legacy = readLegacyFiles();
- const globLike = legacy.filter((file) => /[()[\]]/.test(file));
- expect(globLike.length).toBeGreaterThan(0);
-
- const enforced: string[] = [];
- for (const file of legacy) if (await ruleFor(eslint, file)) enforced.push(file);
- expect(enforced).toEqual([]);
- }, 120_000);
-
- it('applies to new source files and skips tests', async () => {
- expect(await ruleFor(eslint, 'src/features/NewFeature/index.tsx')).toBeDefined();
- expect(await ruleFor(eslint, 'src/routes/(main)/eval/bench/[id]/New.tsx')).toBeDefined();
- expect(await ruleFor(eslint, 'src/features/NewFeature/index.test.tsx')).toBeUndefined();
- }, 120_000);
-});
diff --git a/scripts/stylexMigration/eslint.mjs b/scripts/stylexMigration/oxlint.mjs
similarity index 54%
rename from scripts/stylexMigration/eslint.mjs
rename to scripts/stylexMigration/oxlint.mjs
index 40dc70116e9..d8430d1fc5f 100644
--- a/scripts/stylexMigration/eslint.mjs
+++ b/scripts/stylexMigration/oxlint.mjs
@@ -1,12 +1,10 @@
import { readFileSync } from 'node:fs';
-
-import stylex from '@stylexjs/eslint-plugin';
-import { builtinRules } from 'eslint/use-at-your-own-risk';
+import { fileURLToPath } from 'node:url';
const readJson = (file) => JSON.parse(readFileSync(new URL(file, import.meta.url), 'utf8'));
const legacyImports = readJson('./legacyImports.json');
-// `ignores` entries are globs: route segments like `[benchmarkId]` and `(main)`
+// `excludeFiles` entries are globs: route segments like `[benchmarkId]` and `(main)`
// would otherwise be read as character classes and groups.
const legacyFiles = readJson('./legacyFiles.json').map((file) =>
file.replaceAll(/[!()*+?@[\]{}]/g, String.raw`\$&`),
@@ -16,22 +14,19 @@ const legacyFiles = readJson('./legacyFiles.json').map((file) =>
* StyleX migration guard. New code may not import the emotion-backed style APIs
* from @lobehub/ui; files that still do are listed in legacyFiles.json, which only
* shrinks (`bun run stylex:migration --prune-legacy`).
- *
- * The core no-restricted-imports rule is re-registered under its own name because
- * flat config replaces a rule per file: the src/** blocks already configure
- * no-restricted-imports and would otherwise override this one, or be overridden.
*/
-export const stylexMigrationConfig = [
+export const stylexMigrationOverrides = [
{
files: ['**/*.{ts,tsx}'],
// Tests mock @lobehub/ui, including its style factories; the guard is about
// shipped code.
- ignores: [...legacyFiles, '**/*.test.{ts,tsx}', '**/__tests__/**'],
- plugins: {
- 'stylex-migration': {
- rules: { 'no-emotion-styles': builtinRules.get('no-restricted-imports') },
+ excludeFiles: [...legacyFiles, '**/*.test.{ts,tsx}', '**/__tests__/**'],
+ jsPlugins: [
+ {
+ name: 'stylex-migration',
+ specifier: fileURLToPath(new URL('./oxlintPlugin.mjs', import.meta.url)),
},
- },
+ ],
rules: {
'stylex-migration/no-emotion-styles': [
'error',
@@ -50,17 +45,12 @@ export const stylexMigrationConfig = [
},
},
{
- // sort-keys is left to perfectionist/sort-objects, which already orders keys.
+ // The other StyleX rules come from the preset's `stylex` option; sort-keys is
+ // left to perfectionist/sort-objects, which already orders keys.
files: ['**/*.{ts,tsx}'],
- plugins: { '@stylexjs': stylex },
+ jsPlugins: ['stylex'],
rules: {
'@stylexjs/enforce-extension': 'error',
- '@stylexjs/no-conflicting-props': 'error',
- '@stylexjs/no-legacy-contextual-styles': 'error',
- '@stylexjs/no-lookahead-selectors': 'error',
- '@stylexjs/no-unused': 'error',
- '@stylexjs/valid-shorthands': 'error',
- '@stylexjs/valid-styles': 'error',
},
},
];
diff --git a/scripts/stylexMigration/oxlint.test.ts b/scripts/stylexMigration/oxlint.test.ts
new file mode 100644
index 00000000000..5b3c6629ce7
--- /dev/null
+++ b/scripts/stylexMigration/oxlint.test.ts
@@ -0,0 +1,70 @@
+// @vitest-environment node
+import { spawnSync } from 'node:child_process';
+import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+
+import { defineConfig } from '@lobehub/oxlint-config';
+import { afterAll, beforeAll, describe, expect, it } from 'vitest';
+
+import { readLegacyFiles } from '.';
+import { stylexMigrationOverrides } from './oxlint.mjs';
+
+const repoRoot = path.resolve(import.meta.dirname, '../..');
+const oxlintBin = path.join(repoRoot, 'node_modules/.bin/oxlint');
+const rule = 'stylex-migration(no-emotion-styles)';
+const EMOTION_IMPORT =
+ "import { createStyles } from '@lobehub/ui';\n\nexport const useStyles = createStyles;\n";
+
+describe('stylex-migration/no-emotion-styles config', () => {
+ let dir: string;
+
+ const lintFiles = (files: string[]) => {
+ for (const file of files) {
+ mkdirSync(path.dirname(path.join(dir, file)), { recursive: true });
+ writeFileSync(path.join(dir, file), EMOTION_IMPORT);
+ }
+ const { stdout } = spawnSync(oxlintBin, ['-c', '.oxlintrc.json', '-f', 'json', ...files], {
+ cwd: dir,
+ encoding: 'utf8',
+ maxBuffer: 256 * 1024 * 1024,
+ });
+ const { diagnostics } = JSON.parse(stdout) as {
+ diagnostics: { code?: string; filename: string }[];
+ };
+ return new Set(diagnostics.filter((d) => d.code === rule).map((d) => d.filename));
+ };
+
+ beforeAll(() => {
+ dir = mkdtempSync(path.join(os.tmpdir(), 'stylex-migration-'));
+ const config = defineConfig(
+ { sortImports: false, sortKeys: false },
+ ...(stylexMigrationOverrides as Parameters<typeof defineConfig>[1][]),
+ );
+ writeFileSync(path.join(dir, '.oxlintrc.json'), JSON.stringify(config));
+ });
+
+ afterAll(() => {
+ rmSync(dir, { force: true, recursive: true });
+ });
+
+ it('exempts every legacy file, including route segments read as glob syntax', () => {
+ const legacy = readLegacyFiles();
+ const globLike = legacy.filter((file) => /[()[\]]/.test(file));
+ expect(globLike.length).toBeGreaterThan(0);
+
+ expect([...lintFiles(legacy)]).toEqual([]);
+ }, 120_000);
+
+ it('applies to new source files and skips tests', () => {
+ const reported = lintFiles([
+ 'src/features/NewFeature/index.tsx',
+ 'src/routes/(main)/eval/bench/[id]/New.tsx',
+ 'src/features/NewFeature/index.test.tsx',
+ ]);
+
+ expect(reported).toEqual(
+ new Set(['src/features/NewFeature/index.tsx', 'src/routes/(main)/eval/bench/[id]/New.tsx']),
+ );
+ }, 120_000);
+});
diff --git a/scripts/stylexMigration/oxlintPlugin.mjs b/scripts/stylexMigration/oxlintPlugin.mjs
new file mode 100644
index 00000000000..60a65ddfff0
--- /dev/null
+++ b/scripts/stylexMigration/oxlintPlugin.mjs
@@ -0,0 +1,13 @@
+import core from '@lobehub/oxlint-config/plugins/eslint-core';
+
+/**
+ * Oxlint loads a plugin file once, so the bundled eslint-core plugin cannot be
+ * registered a second time. This local plugin re-exports ESLint's
+ * no-restricted-imports under its own name: the src/** blocks already configure
+ * eslint-core/no-restricted-imports, and a later block would replace those
+ * options rather than add to them.
+ */
+export default {
+ meta: { name: 'stylex-migration' },
+ rules: { 'no-emotion-styles': core.rules['no-restricted-imports'] },
+};
diff --git a/src/components/Branding/ProductLogo/Custom.tsx b/src/components/Branding/ProductLogo/Custom.tsx
index d4217ad526f..583be6ed3c6 100644
--- a/src/components/Branding/ProductLogo/Custom.tsx
+++ b/src/components/Branding/ProductLogo/Custom.tsx
@@ -8,8 +8,8 @@ import * as stylex from '@stylexjs/stylex';
import { type ReactNode } from 'react';
import { memo } from 'react';
-import { type ImageProps } from '@/libs/next/Image';
import Image from '@/libs/next/Image';
+import { type ImageProps } from '@/libs/next/Image';
const styles = stylex.create({ extraTitle: { fontWeight: 300, whiteSpace: 'nowrap' } });
diff --git a/src/components/CodeEditorPane/index.tsx b/src/components/CodeEditorPane/index.tsx
index cb6dae4a426..25a60238d90 100644
--- a/src/components/CodeEditorPane/index.tsx
+++ b/src/components/CodeEditorPane/index.tsx
@@ -163,7 +163,7 @@ const CodeEditorPane = memo<CodeEditorPaneProps>(
const events = ['keyup', 'mouseup', 'focusin'] as const;
// Removed by `detachCursorListeners` in this effect's cleanup, which the
// lint rule cannot follow across the loader promise.
- // eslint-disable-next-line @eslint-react/web-api/no-leaked-event-listener
+ // eslint-disable-next-line @eslint-react/web-api-no-leaked-event-listener
for (const event of events) view.dom.addEventListener(event, syncCursor);
detachCursorListeners = () => {
for (const event of events) view.dom.removeEventListener(event, syncCursor);
diff --git a/src/components/CommentList/CommentItem.module.css b/src/components/CommentList/CommentItem.module.css
index a4a9ec18005..82adfce8dae 100644
--- a/src/components/CommentList/CommentItem.module.css
+++ b/src/components/CommentList/CommentItem.module.css
@@ -21,7 +21,7 @@
color: var(--lobe-color-text);
}
-@media (max-width: 575.98px) {
+@media (width <= 575.98px) {
.content {
font-size: 15px;
}
diff --git a/src/components/DiscreteSlider/index.tsx b/src/components/DiscreteSlider/index.tsx
index 3b492c9a839..c00cab8dcc0 100644
--- a/src/components/DiscreteSlider/index.tsx
+++ b/src/components/DiscreteSlider/index.tsx
@@ -1,5 +1,4 @@
-import { Flexbox } from '@lobehub/ui';
-import { Slider, type SliderProps, Tooltip } from '@lobehub/ui';
+import { Flexbox, Slider, type SliderProps, Tooltip } from '@lobehub/ui';
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
import * as stylex from '@stylexjs/stylex';
import type { CSSProperties, ReactNode } from 'react';
diff --git a/src/components/GuideModal/index.tsx b/src/components/GuideModal/index.tsx
index 04491edcca6..8fe7e09cfc9 100644
--- a/src/components/GuideModal/index.tsx
+++ b/src/components/GuideModal/index.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
-import { Button, createModal, type ModalInstance, useModalContext } from '@lobehub/ui';
+import { Button, createModal, Flexbox, type ModalInstance, useModalContext } from '@lobehub/ui';
import { type ReactNode } from 'react';
import { memo } from 'react';
diff --git a/src/components/InlineRename/index.tsx b/src/components/InlineRename/index.tsx
index fe02cfae78b..ffb4416d21b 100644
--- a/src/components/InlineRename/index.tsx
+++ b/src/components/InlineRename/index.tsx
@@ -1,7 +1,12 @@
'use client';
-import { Popover, stopPropagation } from '@lobehub/ui';
-import { Input, type InputProps, type PopoverPlacement } from '@lobehub/ui';
+import {
+ Input,
+ type InputProps,
+ Popover,
+ type PopoverPlacement,
+ stopPropagation,
+} from '@lobehub/ui';
import { type KeyboardEvent } from 'react';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
diff --git a/src/components/InlineTable/index.tsx b/src/components/InlineTable/index.tsx
index bb2e15b0bff..58857e531ec 100644
--- a/src/components/InlineTable/index.tsx
+++ b/src/components/InlineTable/index.tsx
@@ -1,5 +1,4 @@
-import { Table, type TableProps } from '@lobehub/ui';
-import { cx } from '@lobehub/ui';
+import { cx, Table, type TableProps } from '@lobehub/ui';
import * as stylex from '@stylexjs/stylex';
import { sx } from '@/styles/sx';
diff --git a/src/components/Link.tsx b/src/components/Link.tsx
index 8aeb75b0ce2..e940c61afdc 100644
--- a/src/components/Link.tsx
+++ b/src/components/Link.tsx
@@ -1,5 +1,5 @@
-import { type AnchorHTMLAttributes } from 'react';
import React, { memo } from 'react';
+import { type AnchorHTMLAttributes } from 'react';
import { Link as RouterLink } from 'react-router';
interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
diff --git a/src/components/Loading/BrandTextLoading/index.module.css b/src/components/Loading/BrandTextLoading/index.module.css
index 0025fe3093a..6b4d4c2620e 100644
--- a/src/components/Loading/BrandTextLoading/index.module.css
+++ b/src/components/Loading/BrandTextLoading/index.module.css
@@ -2,33 +2,34 @@
--brand-text-color: var(--colorText, #1f1f1f);
--brand-muted-color: var(--colorTextSecondary, #8c8c8c);
--brand-border-color: var(--colorBorder, #d9d9d9);
- --brand-tag-bg: var(--colorFillTertiary, rgba(0, 0, 0, 0.04));
+ --brand-tag-bg: var(--colorFillTertiary, rgb(0 0 0 / 4%));
display: flex;
flex-direction: column;
+ gap: 12px;
align-items: center;
justify-content: center;
width: 100%;
height: 100vh;
height: 100dvh;
- gap: 12px;
}
[data-theme='dark'] .container {
--brand-text-color: var(--colorText, #f0f0f0);
--brand-muted-color: var(--colorTextSecondary, #a6a6a6);
--brand-border-color: var(--colorBorder, #424242);
- --brand-tag-bg: var(--colorFillTertiary, rgba(255, 255, 255, 0.08));
+ --brand-tag-bg: var(--colorFillTertiary, rgb(255 255 255 / 8%));
}
.brand {
display: flex;
- align-items: center;
gap: 12px;
+ align-items: center;
- opacity: 0.6;
color: var(--brand-text-color);
+
+ opacity: 0.6;
}
.brand :global(.lobe-brand-loading) {
@@ -39,8 +40,8 @@
.debug {
display: flex;
flex-direction: column;
- align-items: center;
gap: 4px;
+ align-items: center;
padding: 16px;
}
@@ -64,7 +65,8 @@
display: inline-flex;
align-items: center;
- padding: 2px 8px;
+ padding-block: 2px;
+ padding-inline: 8px;
border-radius: 6px;
background: var(--brand-tag-bg);
diff --git a/src/components/MCPStdioCommandInput/index.tsx b/src/components/MCPStdioCommandInput/index.tsx
index 040e5e0191a..177ac9bd09d 100644
--- a/src/components/MCPStdioCommandInput/index.tsx
+++ b/src/components/MCPStdioCommandInput/index.tsx
@@ -6,8 +6,7 @@ import {
SiPnpm,
SiPython,
} from '@icons-pack/react-simple-icons';
-import { Flexbox } from '@lobehub/ui';
-import { AutoComplete, type AutoCompleteProps } from '@lobehub/ui';
+import { AutoComplete, type AutoCompleteProps, Flexbox } from '@lobehub/ui';
import { type FC } from 'react';
import { memo } from 'react';
diff --git a/src/components/Menu/index.tsx b/src/components/Menu/index.tsx
index 26323b4979c..5d1dbc8dc26 100644
--- a/src/components/Menu/index.tsx
+++ b/src/components/Menu/index.tsx
@@ -1,5 +1,4 @@
-import { List, type ListProps } from '@lobehub/ui';
-import { cx } from '@lobehub/ui';
+import { cx, List, type ListProps } from '@lobehub/ui';
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
import { memo } from 'react';
diff --git a/src/components/RenameModal/index.tsx b/src/components/RenameModal/index.tsx
index c25ca606c17..fb299a68cbd 100644
--- a/src/components/RenameModal/index.tsx
+++ b/src/components/RenameModal/index.tsx
@@ -1,7 +1,14 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
-import { Button, createModal, Input, type ModalInstance, Text, useModalContext } from '@lobehub/ui';
+import {
+ Button,
+ createModal,
+ Flexbox,
+ Input,
+ type ModalInstance,
+ Text,
+ useModalContext,
+} from '@lobehub/ui';
import { t } from 'i18next';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/components/TipGuide/index.tsx b/src/components/TipGuide/index.tsx
index 84f1874cb65..663f77c7185 100644
--- a/src/components/TipGuide/index.tsx
+++ b/src/components/TipGuide/index.tsx
@@ -1,5 +1,4 @@
-import { Flexbox, Popover } from '@lobehub/ui';
-import { ActionIcon, type PopoverPlacement } from '@lobehub/ui';
+import { ActionIcon, Flexbox, Popover, type PopoverPlacement } from '@lobehub/ui';
import * as stylex from '@stylexjs/stylex';
import { XIcon } from 'lucide-react';
import { type CSSProperties, type FC, type ReactNode } from 'react';
diff --git a/src/features/Acceptance/Viewer/Checks/AddCheckModal.tsx b/src/features/Acceptance/Viewer/Checks/AddCheckModal.tsx
index ffd77e323c8..ad3a100e422 100644
--- a/src/features/Acceptance/Viewer/Checks/AddCheckModal.tsx
+++ b/src/features/Acceptance/Viewer/Checks/AddCheckModal.tsx
@@ -1,10 +1,12 @@
'use client';
import type { AcceptanceChecklistItem } from '@lobechat/types';
-import { cssVar, Flexbox, Icon } from '@lobehub/ui';
import {
Button,
createModal,
+ cssVar,
+ Flexbox,
+ Icon,
Input,
type ModalInstance,
Select,
diff --git a/src/features/Acceptance/Viewer/Review/modals.tsx b/src/features/Acceptance/Viewer/Review/modals.tsx
index e2149a9c2b4..4e6a8e53564 100644
--- a/src/features/Acceptance/Viewer/Review/modals.tsx
+++ b/src/features/Acceptance/Viewer/Review/modals.tsx
@@ -1,9 +1,11 @@
'use client';
-import { createStaticStyles, cssVar, Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
+ createStaticStyles,
+ cssVar,
+ Flexbox,
type ModalInstance,
Text,
TextArea,
diff --git a/src/features/Acceptance/Workspace/AcceptanceDeleteConfirm.tsx b/src/features/Acceptance/Workspace/AcceptanceDeleteConfirm.tsx
index c6dd938ec35..c1dc1c64070 100644
--- a/src/features/Acceptance/Workspace/AcceptanceDeleteConfirm.tsx
+++ b/src/features/Acceptance/Workspace/AcceptanceDeleteConfirm.tsx
@@ -1,10 +1,12 @@
'use client';
-import { createStaticStyles, cssVar, Flexbox } from '@lobehub/ui';
import {
Button,
Checkbox,
createModal,
+ createStaticStyles,
+ cssVar,
+ Flexbox,
type ModalInstance,
Text,
toast,
diff --git a/src/features/Acceptance/Workspace/MergeAcceptanceModal.tsx b/src/features/Acceptance/Workspace/MergeAcceptanceModal.tsx
index 145bea0abe8..c814c73a325 100644
--- a/src/features/Acceptance/Workspace/MergeAcceptanceModal.tsx
+++ b/src/features/Acceptance/Workspace/MergeAcceptanceModal.tsx
@@ -1,7 +1,17 @@
'use client';
-import { createStaticStyles, cssVar, Empty, Flexbox, Icon } from '@lobehub/ui';
-import { Button, createModal, type ModalInstance, Text, useModalContext } from '@lobehub/ui';
+import {
+ Button,
+ createModal,
+ createStaticStyles,
+ cssVar,
+ Empty,
+ Flexbox,
+ Icon,
+ type ModalInstance,
+ Text,
+ useModalContext,
+} from '@lobehub/ui';
import { t } from 'i18next';
import { Search, TriangleAlert } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/features/AddAgentMemberModal/AvailableAgentList.tsx b/src/features/AddAgentMemberModal/AvailableAgentList.tsx
index 4badf692ff6..32e3159b0bd 100644
--- a/src/features/AddAgentMemberModal/AvailableAgentList.tsx
+++ b/src/features/AddAgentMemberModal/AvailableAgentList.tsx
@@ -12,8 +12,8 @@ import AgentSelectionEmpty from '@/features/AgentSelectionEmpty';
import { useHomeStore } from '@/store/home';
import { homeAgentListSelectors } from '@/store/home/selectors';
-import { type AgentItemData } from './AgentItem';
import AgentItem from './AgentItem';
+import { type AgentItemData } from './AgentItem';
type Row = { agent: AgentItemData; type: 'agent' } | { label: string; type: 'header' };
diff --git a/src/features/AddAgentMemberModal/SelectedAgentList.tsx b/src/features/AddAgentMemberModal/SelectedAgentList.tsx
index d9af51f2209..536912a3e1a 100644
--- a/src/features/AddAgentMemberModal/SelectedAgentList.tsx
+++ b/src/features/AddAgentMemberModal/SelectedAgentList.tsx
@@ -6,8 +6,8 @@ import { useTranslation } from 'react-i18next';
import AgentSelectionEmpty from '@/features/AgentSelectionEmpty';
-import { type AgentItemData } from './AgentItem';
import AgentItem from './AgentItem';
+import { type AgentItemData } from './AgentItem';
import { useAgentSelectionStore } from './store';
const styles = createStaticStyles(({ css, cssVar }) => ({
diff --git a/src/features/AgentBuilder/TopicSelector.tsx b/src/features/AgentBuilder/TopicSelector.tsx
index 6fc2d9f02dd..9d47e9d130b 100644
--- a/src/features/AgentBuilder/TopicSelector.tsx
+++ b/src/features/AgentBuilder/TopicSelector.tsx
@@ -77,7 +77,7 @@ const TopicSelector = memo<TopicSelectorProps>(({ agentId, disabled }) => {
type: 'checkbox',
};
}),
- [topics, switchTopic, styles, activeTopicId],
+ [topics, switchTopic, activeTopicId],
);
const isEmpty = !topics || topics.length === 0;
diff --git a/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx b/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx
index 0333feaa583..f3feac6d4af 100644
--- a/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx
+++ b/src/features/AgentDocumentsExplorer/ConvertToSkillModal.tsx
@@ -1,9 +1,10 @@
'use client';
-import { cssVar, Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
+ cssVar,
+ Flexbox,
Input,
type ModalInstance,
Text,
diff --git a/src/features/AgentGoals/NorthStarMetrics/DeclareMetricModal.tsx b/src/features/AgentGoals/NorthStarMetrics/DeclareMetricModal.tsx
index bc187cba3f4..3f22167ac58 100644
--- a/src/features/AgentGoals/NorthStarMetrics/DeclareMetricModal.tsx
+++ b/src/features/AgentGoals/NorthStarMetrics/DeclareMetricModal.tsx
@@ -1,10 +1,10 @@
'use client';
import type { GoalMetricComparison, GoalMetricCriterion } from '@lobechat/types';
-import { Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
+ Flexbox,
Input,
type ModalInstance,
Select,
diff --git a/src/features/AgentGoals/NorthStarMetrics/RecordObservationModal.tsx b/src/features/AgentGoals/NorthStarMetrics/RecordObservationModal.tsx
index 82e19d95233..f59bb2257a7 100644
--- a/src/features/AgentGoals/NorthStarMetrics/RecordObservationModal.tsx
+++ b/src/features/AgentGoals/NorthStarMetrics/RecordObservationModal.tsx
@@ -1,9 +1,9 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
+ Flexbox,
Input,
type ModalInstance,
Text,
diff --git a/src/features/AgentGoals/ProcessControl/RequestChangesModal.tsx b/src/features/AgentGoals/ProcessControl/RequestChangesModal.tsx
index 179418d50d9..cbce3dd65ba 100644
--- a/src/features/AgentGoals/ProcessControl/RequestChangesModal.tsx
+++ b/src/features/AgentGoals/ProcessControl/RequestChangesModal.tsx
@@ -1,9 +1,10 @@
'use client';
-import { cssVar, Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
+ cssVar,
+ Flexbox,
type ModalInstance,
Text,
TextArea,
diff --git a/src/features/AgentProfileArtwork/index.tsx b/src/features/AgentProfileArtwork/index.tsx
index 46c96a9f00b..f2e4c28df42 100644
--- a/src/features/AgentProfileArtwork/index.tsx
+++ b/src/features/AgentProfileArtwork/index.tsx
@@ -5,15 +5,20 @@ import {
type AgentArtworkStyle,
DEFAULT_AGENT_ARTWORK_STYLE,
} from '@lobechat/prompts';
-import { Center, createStaticStyles, cssVar, Flexbox, Icon, Tooltip } from '@lobehub/ui';
import {
ActionIcon,
Button,
+ Center,
+ createStaticStyles,
+ cssVar,
type DropdownItem,
DropdownMenu,
+ Flexbox,
+ Icon,
Spin,
Text,
toast,
+ Tooltip,
} from '@lobehub/ui';
import { Check, ImageIcon, MoreHorizontal, Trash2, UploadIcon, WandSparkles } from 'lucide-react';
import { memo, useCallback, useId, useRef, useState } from 'react';
diff --git a/src/features/AgentQuotaCalendar/QuotaCalendarModal.tsx b/src/features/AgentQuotaCalendar/QuotaCalendarModal.tsx
index b36ddacbcb9..1acebde3176 100644
--- a/src/features/AgentQuotaCalendar/QuotaCalendarModal.tsx
+++ b/src/features/AgentQuotaCalendar/QuotaCalendarModal.tsx
@@ -2,14 +2,18 @@
import type { QuotaLimitReading } from '@lobechat/heterogeneous-agents/quota';
import { projectWindows } from '@lobechat/heterogeneous-agents/quota';
-import { createStaticStyles, cssVar, Flexbox, Icon, Tooltip } from '@lobehub/ui';
import {
ActionIcon,
createModal,
+ createStaticStyles,
+ cssVar,
+ Flexbox,
+ Icon,
type ModalInstance,
Segmented,
Skeleton,
Text,
+ Tooltip,
} from '@lobehub/ui';
import dayjs from 'dayjs';
import type { TFunction } from 'i18next';
diff --git a/src/features/AgentSetting/AgentSettingsProvider.tsx b/src/features/AgentSetting/AgentSettingsProvider.tsx
index 35eb9f254d8..4df7cb2f15a 100644
--- a/src/features/AgentSetting/AgentSettingsProvider.tsx
+++ b/src/features/AgentSetting/AgentSettingsProvider.tsx
@@ -2,8 +2,8 @@ import { type ReactNode } from 'react';
import { memo } from 'react';
import { createStore, Provider } from './store';
-import { type StoreUpdaterProps } from './StoreUpdater';
import StoreUpdater from './StoreUpdater';
+import { type StoreUpdaterProps } from './StoreUpdater';
interface AgentSettingsProps extends StoreUpdaterProps {
children: ReactNode;
diff --git a/src/features/AgentTasks/AgentTaskDetail/CommentCard.tsx b/src/features/AgentTasks/AgentTaskDetail/CommentCard.tsx
index 2bf1384c943..3d166819fee 100644
--- a/src/features/AgentTasks/AgentTaskDetail/CommentCard.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/CommentCard.tsx
@@ -1,8 +1,20 @@
import type { TaskDetailActivity } from '@lobechat/types';
import { useEditor } from '@lobehub/editor/react';
import { LexicalRenderer } from '@lobehub/editor/renderer';
-import { Block, type DropdownItem, DropdownMenu, Flexbox, Icon, Markdown } from '@lobehub/ui';
-import { ActionIcon, Avatar, Button, confirmModal, cssVar, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Avatar,
+ Block,
+ Button,
+ confirmModal,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ Markdown,
+ Text,
+} from '@lobehub/ui';
import { MessageCircle, MoreHorizontal, Pencil, Trash } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskArtifacts.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskArtifacts.tsx
index 8a9554fc479..2a65e80d93b 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskArtifacts.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskArtifacts.tsx
@@ -1,6 +1,16 @@
import type { TaskDetailWorkspaceNode } from '@lobechat/types';
-import { Block, type DropdownItem, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, confirmModal, cssVar, Tag, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Block,
+ confirmModal,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ Tag,
+ Text,
+} from '@lobehub/ui';
import { FileLock2Icon, FileTextIcon, MoreHorizontal, Package, Trash } from 'lucide-react';
import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskBriefCard.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskBriefCard.tsx
index 2f8bbcfd101..e7fffa2074f 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskBriefCard.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskBriefCard.tsx
@@ -1,5 +1,15 @@
-import { Block, type DropdownItem, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, confirmModal, cssVar, Text, toast } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Block,
+ confirmModal,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ Text,
+ toast,
+} from '@lobehub/ui';
import { Check, ChevronDownIcon, ChevronUpIcon, MoreHorizontal, Trash } from 'lucide-react';
import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx b/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
index 2c9a2571df2..908cfee081a 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TaskVerifyConfig.tsx
@@ -1,13 +1,17 @@
'use client';
import { AgentRuntimeErrorType } from '@lobechat/types';
-import { Block, createStaticStyles, cssVar, Flexbox, Icon } from '@lobehub/ui';
import {
ActionIcon,
+ Block,
Button,
confirmModal,
+ createStaticStyles,
+ cssVar,
type DropdownItem,
DropdownMenu,
+ Flexbox,
+ Icon,
Select,
Spin,
Tag,
diff --git a/src/features/AgentTasks/AgentTaskDetail/TopicCard.tsx b/src/features/AgentTasks/AgentTaskDetail/TopicCard.tsx
index a04babb837e..ce1f37dd942 100644
--- a/src/features/AgentTasks/AgentTaskDetail/TopicCard.tsx
+++ b/src/features/AgentTasks/AgentTaskDetail/TopicCard.tsx
@@ -1,14 +1,20 @@
import type { TaskDetailActivity } from '@lobechat/types';
import { formatDuration } from '@lobechat/utils';
import {
+ ActionIcon,
+ Avatar,
Block,
+ confirmModal,
+ cssVar,
type DropdownItem,
DropdownMenu,
Flexbox,
Markdown,
stopPropagation,
+ Tag,
+ Text,
+ toast,
} from '@lobehub/ui';
-import { ActionIcon, Avatar, confirmModal, cssVar, Tag, Text, toast } from '@lobehub/ui';
import {
ChevronDown,
ChevronRight,
diff --git a/src/features/AgentTasks/AgentTaskList/KanbanColumn.tsx b/src/features/AgentTasks/AgentTaskList/KanbanColumn.tsx
index 744e315766d..348c6d136f2 100644
--- a/src/features/AgentTasks/AgentTaskList/KanbanColumn.tsx
+++ b/src/features/AgentTasks/AgentTaskList/KanbanColumn.tsx
@@ -1,7 +1,15 @@
import { useDndContext, useDraggable, useDroppable } from '@dnd-kit/core';
import type { TaskStatus } from '@lobechat/types';
-import { type DropdownItem, DropdownMenu, Icon } from '@lobehub/ui';
-import { ActionIcon, createStaticStyles, cx, Skeleton, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ createStaticStyles,
+ cx,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ Skeleton,
+ Text,
+} from '@lobehub/ui';
import { EyeOff, MoreHorizontal, Plus } from 'lucide-react';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx b/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx
index e4bbf956754..5a6eebe5c01 100644
--- a/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx
+++ b/src/features/AgentTasks/AgentTaskList/TaskListVisibilityFilter.tsx
@@ -1,7 +1,13 @@
'use client';
-import { type DropdownItem, DropdownMenu, Icon, type MenuInfo } from '@lobehub/ui';
-import { ActionIcon, cssVar } from '@lobehub/ui';
+import {
+ ActionIcon,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ type MenuInfo,
+} from '@lobehub/ui';
import { Globe, LockIcon, UsersIcon } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/features/TaskPriorityTag.tsx b/src/features/AgentTasks/features/TaskPriorityTag.tsx
index 0e0b0806c10..9a4dd2b7d1e 100644
--- a/src/features/AgentTasks/features/TaskPriorityTag.tsx
+++ b/src/features/AgentTasks/features/TaskPriorityTag.tsx
@@ -1,6 +1,13 @@
import type { IconType } from '@lobehub/icons';
-import { type DropdownItem, DropdownMenu, type MenuInfo, Tooltip } from '@lobehub/ui';
-import { createStaticStyles, cssVar, Spin } from '@lobehub/ui';
+import {
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ type MenuInfo,
+ Spin,
+ Tooltip,
+} from '@lobehub/ui';
import type { ReactNode } from 'react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/features/TaskStatusTag.tsx b/src/features/AgentTasks/features/TaskStatusTag.tsx
index a9a076b0c85..21107b66549 100644
--- a/src/features/AgentTasks/features/TaskStatusTag.tsx
+++ b/src/features/AgentTasks/features/TaskStatusTag.tsx
@@ -1,6 +1,14 @@
import type { TaskStatus } from '@lobechat/types';
-import { type DropdownItem, DropdownMenu, Icon, type MenuInfo, Tooltip } from '@lobehub/ui';
-import { createStaticStyles, cssVar, Spin } from '@lobehub/ui';
+import {
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ type MenuInfo,
+ Spin,
+ Tooltip,
+} from '@lobehub/ui';
import type { ReactNode } from 'react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AgentTasks/features/TaskVisibilityTag.tsx b/src/features/AgentTasks/features/TaskVisibilityTag.tsx
index 7b80d55556c..767c5c11f19 100644
--- a/src/features/AgentTasks/features/TaskVisibilityTag.tsx
+++ b/src/features/AgentTasks/features/TaskVisibilityTag.tsx
@@ -1,5 +1,13 @@
-import { type DropdownItem, DropdownMenu, Icon, type MenuInfo, Tooltip } from '@lobehub/ui';
-import { createStaticStyles, cssVar, Spin } from '@lobehub/ui';
+import {
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ type MenuInfo,
+ Spin,
+ Tooltip,
+} from '@lobehub/ui';
import { LockIcon, UsersIcon } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo, useCallback, useMemo, useState } from 'react';
diff --git a/src/features/AgentTasks/features/useTaskItemContextMenu.tsx b/src/features/AgentTasks/features/useTaskItemContextMenu.tsx
index 6763f60a022..56febfcfadb 100644
--- a/src/features/AgentTasks/features/useTaskItemContextMenu.tsx
+++ b/src/features/AgentTasks/features/useTaskItemContextMenu.tsx
@@ -1,7 +1,14 @@
import type { TaskStatus } from '@lobechat/types';
import { isTaskArchiveBlocked } from '@lobechat/types';
-import { type ContextMenuItem, copyToClipboard, Icon, type MenuInfo } from '@lobehub/ui';
-import { confirmModal, cssVar, toast } from '@lobehub/ui';
+import {
+ confirmModal,
+ type ContextMenuItem,
+ copyToClipboard,
+ cssVar,
+ Icon,
+ type MenuInfo,
+ toast,
+} from '@lobehub/ui';
import {
ArchiveIcon,
ArchiveRestoreIcon,
diff --git a/src/features/AgentViewAll/AgentRow.tsx b/src/features/AgentViewAll/AgentRow.tsx
index 0af70e4a65b..fc65589bcee 100644
--- a/src/features/AgentViewAll/AgentRow.tsx
+++ b/src/features/AgentViewAll/AgentRow.tsx
@@ -3,8 +3,18 @@
import { AGENT_CHAT_URL, DEFAULT_AVATAR, GROUP_CHAT_URL } from '@lobechat/const';
import type { SidebarAgentItem } from '@lobechat/types';
import { agentDisplayName, agentSecondaryDisplayName } from '@lobechat/types';
-import { ContextMenuTrigger, type DropdownItem, Flexbox, Tooltip } from '@lobehub/ui';
-import { ActionIcon, Avatar, createStaticStyles, cssVar, cx, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Avatar,
+ ContextMenuTrigger,
+ createStaticStyles,
+ cssVar,
+ cx,
+ type DropdownItem,
+ Flexbox,
+ Text,
+ Tooltip,
+} from '@lobehub/ui';
import dayjs from 'dayjs';
import { EyeIcon, EyeOffIcon } from 'lucide-react';
import { memo, type MouseEvent, useCallback, useRef, useState } from 'react';
diff --git a/src/features/AgentViewAll/SidebarAgentsSection.tsx b/src/features/AgentViewAll/SidebarAgentsSection.tsx
index 45e7d97fad7..05e017ee9fb 100644
--- a/src/features/AgentViewAll/SidebarAgentsSection.tsx
+++ b/src/features/AgentViewAll/SidebarAgentsSection.tsx
@@ -3,8 +3,17 @@
import { AGENT_CHAT_URL, GROUP_CHAT_URL } from '@lobechat/const';
import type { SidebarAgentItem } from '@lobechat/types';
import { agentDisplayName, agentSecondaryDisplayName } from '@lobechat/types';
-import { Block, ContextMenuTrigger, type DropdownItem, Flexbox, Icon } from '@lobehub/ui';
-import { createStaticStyles, cssVar, Tag, Text } from '@lobehub/ui';
+import {
+ Block,
+ ContextMenuTrigger,
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ Flexbox,
+ Icon,
+ Tag,
+ Text,
+} from '@lobehub/ui';
import { ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
import { memo, useCallback, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AuthShell/AuthLangButton.tsx b/src/features/AuthShell/AuthLangButton.tsx
index 771ffa87fde..479ffae38b1 100644
--- a/src/features/AuthShell/AuthLangButton.tsx
+++ b/src/features/AuthShell/AuthLangButton.tsx
@@ -1,7 +1,6 @@
'use client';
-import { DropdownMenu, type DropdownMenuCheckboxItem, Flexbox } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui';
+import { Button, DropdownMenu, type DropdownMenuCheckboxItem, Flexbox, Text } from '@lobehub/ui';
import { GlobeIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/AuthShell/AuthThemeButton.tsx b/src/features/AuthShell/AuthThemeButton.tsx
index 6356a8e27fb..7727548ea68 100644
--- a/src/features/AuthShell/AuthThemeButton.tsx
+++ b/src/features/AuthShell/AuthThemeButton.tsx
@@ -1,7 +1,6 @@
'use client';
-import { DropdownMenu, type DropdownMenuProps, Icon } from '@lobehub/ui';
-import { ActionIcon } from '@lobehub/ui';
+import { ActionIcon, DropdownMenu, type DropdownMenuProps, Icon } from '@lobehub/ui';
import { Monitor, Moon, Sun } from 'lucide-react';
import { useTheme as useNextThemesTheme } from 'next-themes';
import { memo, useMemo } from 'react';
diff --git a/src/features/BackgroundActivity/ProcessExplorer/index.tsx b/src/features/BackgroundActivity/ProcessExplorer/index.tsx
index b47247131cb..48f15fff004 100644
--- a/src/features/BackgroundActivity/ProcessExplorer/index.tsx
+++ b/src/features/BackgroundActivity/ProcessExplorer/index.tsx
@@ -1,6 +1,15 @@
import { BRANDING_NAME } from '@lobechat/business-const';
-import { cx, Flexbox, Icon } from '@lobehub/ui';
-import { Input, showContextMenu, Skeleton, toast, Tree, type TreeDataNode } from '@lobehub/ui';
+import {
+ cx,
+ Flexbox,
+ Icon,
+ Input,
+ showContextMenu,
+ Skeleton,
+ toast,
+ Tree,
+ type TreeDataNode,
+} from '@lobehub/ui';
import {
AppWindowIcon,
BoxIcon,
diff --git a/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx b/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx
index 2af0c54113b..9039963fac2 100644
--- a/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx
+++ b/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx
@@ -1,5 +1,4 @@
-import { createStaticStyles, TooltipGroup } from '@lobehub/ui';
-import { Select, type SelectProps } from '@lobehub/ui';
+import { createStaticStyles, Select, type SelectProps, TooltipGroup } from '@lobehub/ui';
import { type ReactNode } from 'react';
import { memo, useMemo } from 'react';
diff --git a/src/features/ChatInput/ControlBar/CreateBranchModal.tsx b/src/features/ChatInput/ControlBar/CreateBranchModal.tsx
index f1a25393ab7..077d15c1140 100644
--- a/src/features/ChatInput/ControlBar/CreateBranchModal.tsx
+++ b/src/features/ChatInput/ControlBar/CreateBranchModal.tsx
@@ -1,7 +1,15 @@
'use client';
-import { cssVar, Flexbox } from '@lobehub/ui';
-import { Button, createModal, Input, type ModalInstance, Text, useModalContext } from '@lobehub/ui';
+import {
+ Button,
+ createModal,
+ cssVar,
+ Flexbox,
+ Input,
+ type ModalInstance,
+ Text,
+ useModalContext,
+} from '@lobehub/ui';
import { t } from 'i18next';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ChatInput/ControlBar/CreateWorktreeModal.tsx b/src/features/ChatInput/ControlBar/CreateWorktreeModal.tsx
index be549603341..9bbccf463ba 100644
--- a/src/features/ChatInput/ControlBar/CreateWorktreeModal.tsx
+++ b/src/features/ChatInput/ControlBar/CreateWorktreeModal.tsx
@@ -1,10 +1,11 @@
'use client';
-import { cssVar, Flexbox } from '@lobehub/ui';
import {
ActionIcon,
Button,
createModal,
+ cssVar,
+ Flexbox,
Input,
type ModalInstance,
Skeleton,
diff --git a/src/features/ChatInput/ControlBar/HeteroControlBar/QuotaMenu/QuotaAccountManagerModal.tsx b/src/features/ChatInput/ControlBar/HeteroControlBar/QuotaMenu/QuotaAccountManagerModal.tsx
index 92f487f1775..056b29ab77a 100644
--- a/src/features/ChatInput/ControlBar/HeteroControlBar/QuotaMenu/QuotaAccountManagerModal.tsx
+++ b/src/features/ChatInput/ControlBar/HeteroControlBar/QuotaMenu/QuotaAccountManagerModal.tsx
@@ -2,11 +2,13 @@
import { isDesktop } from '@lobechat/const';
import { currentUtilization, isWeeklyAllLimit } from '@lobechat/heterogeneous-agents/quota';
-import { DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
import {
ActionIcon,
Button,
createModal,
+ DropdownMenu,
+ Flexbox,
+ Icon,
Input,
type ModalInstance,
RadioGroup,
diff --git a/src/features/ChatInput/ControlBar/RenameBranchModal.tsx b/src/features/ChatInput/ControlBar/RenameBranchModal.tsx
index 6fef25285d3..e7b3a3ec18b 100644
--- a/src/features/ChatInput/ControlBar/RenameBranchModal.tsx
+++ b/src/features/ChatInput/ControlBar/RenameBranchModal.tsx
@@ -1,7 +1,15 @@
'use client';
-import { cssVar, Flexbox } from '@lobehub/ui';
-import { Button, createModal, Input, type ModalInstance, Text, useModalContext } from '@lobehub/ui';
+import {
+ Button,
+ createModal,
+ cssVar,
+ Flexbox,
+ Input,
+ type ModalInstance,
+ Text,
+ useModalContext,
+} from '@lobehub/ui';
import { t } from 'i18next';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ChatInput/Desktop/index.tsx b/src/features/ChatInput/Desktop/index.tsx
index 6825e64f4c3..fd982e4f9df 100644
--- a/src/features/ChatInput/Desktop/index.tsx
+++ b/src/features/ChatInput/Desktop/index.tsx
@@ -3,8 +3,7 @@
import { type ChatInputProps } from '@lobehub/editor/react';
import { ChatInput, ChatInputActionBar } from '@lobehub/editor/react';
import { Center, createStaticStyles, cx, Flexbox, Skeleton, Text } from '@lobehub/ui';
-import { type ReactNode, use } from 'react';
-import { memo, useEffect } from 'react';
+import { memo, type ReactNode, use, useEffect } from 'react';
import { createPortal } from 'react-dom';
import { useTranslation } from 'react-i18next';
@@ -18,8 +17,8 @@ import { fileChatSelectors, useFileStore } from '@/store/file';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
-import { type ActionToolbarProps } from '../ActionBar';
import ActionBar from '../ActionBar';
+import { type ActionToolbarProps } from '../ActionBar';
import ControlBar from '../ControlBar';
import InputEditor from '../InputEditor';
import { useSkillDrop } from '../InputEditor/ActionTag/useSkillDrop';
diff --git a/src/features/CommunityWorkspaceSettings/index.tsx b/src/features/CommunityWorkspaceSettings/index.tsx
index 5641e2e613a..565574a5274 100644
--- a/src/features/CommunityWorkspaceSettings/index.tsx
+++ b/src/features/CommunityWorkspaceSettings/index.tsx
@@ -1,9 +1,13 @@
'use client';
import { OFFICIAL_URL } from '@lobechat/const';
-import { Center, createStaticStyles, cssVar, Flexbox, Icon, Tooltip } from '@lobehub/ui';
import {
Button,
+ Center,
+ createStaticStyles,
+ cssVar,
+ Flexbox,
+ Icon,
Input,
Table,
type TableColumn,
@@ -12,6 +16,7 @@ import {
Text,
TextArea,
toast,
+ Tooltip,
Upload,
} from '@lobehub/ui';
import {
diff --git a/src/features/ConnectAgent/index.tsx b/src/features/ConnectAgent/index.tsx
index bbc03b3eec0..e5facaca7c2 100644
--- a/src/features/ConnectAgent/index.tsx
+++ b/src/features/ConnectAgent/index.tsx
@@ -9,17 +9,21 @@ import type {
import { isRemoteHeterogeneousType } from '@lobechat/heterogeneous-agents';
import type { DeviceListItem } from '@lobechat/types';
import { agentDisplayName } from '@lobechat/types';
-import { createStaticStyles, cssVar, Flexbox, Icon, Tooltip } from '@lobehub/ui';
import {
Alert,
Button,
Checkbox,
createModal,
+ createStaticStyles,
+ cssVar,
+ Flexbox,
+ Icon,
Input,
type ModalInstance,
ScrollArea,
Text,
TextArea,
+ Tooltip,
useModalContext,
} from '@lobehub/ui';
import { t as i18nT } from 'i18next';
diff --git a/src/features/Conversation/ChatInput/VerifyTray/EditModal.tsx b/src/features/Conversation/ChatInput/VerifyTray/EditModal.tsx
index fb68831d525..e0c2705eb2e 100644
--- a/src/features/Conversation/ChatInput/VerifyTray/EditModal.tsx
+++ b/src/features/Conversation/ChatInput/VerifyTray/EditModal.tsx
@@ -1,9 +1,9 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
+ Flexbox,
Input,
type ModalInstance,
Text,
diff --git a/src/features/Conversation/ChatInput/VerifyTray/GoalModal.tsx b/src/features/Conversation/ChatInput/VerifyTray/GoalModal.tsx
index 4ef0d50ac11..041289f9474 100644
--- a/src/features/Conversation/ChatInput/VerifyTray/GoalModal.tsx
+++ b/src/features/Conversation/ChatInput/VerifyTray/GoalModal.tsx
@@ -1,9 +1,9 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
+ Flexbox,
type ModalInstance,
Text,
TextArea,
diff --git a/src/features/Conversation/Markdown/plugins/GoalTurn/Render.tsx b/src/features/Conversation/Markdown/plugins/GoalTurn/Render.tsx
index a0e610838d1..0e05c9ed92d 100644
--- a/src/features/Conversation/Markdown/plugins/GoalTurn/Render.tsx
+++ b/src/features/Conversation/Markdown/plugins/GoalTurn/Render.tsx
@@ -1,7 +1,14 @@
'use client';
-import { createStaticStyles, cx, Flexbox, Icon } from '@lobehub/ui';
-import { Accordion, type AccordionItemType, Text } from '@lobehub/ui';
+import {
+ Accordion,
+ type AccordionItemType,
+ createStaticStyles,
+ cx,
+ Flexbox,
+ Icon,
+ Text,
+} from '@lobehub/ui';
import dayjs from 'dayjs';
import { TargetIcon } from 'lucide-react';
import { useMemo, useState } from 'react';
diff --git a/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx b/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx
index 202fc9e1431..20c3d353625 100644
--- a/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx
+++ b/src/features/Conversation/Messages/AssistantGroup/Tool/Debug/index.tsx
@@ -1,6 +1,5 @@
import { type ToolIntervention } from '@lobechat/types';
-import { Block, Highlighter, Icon } from '@lobehub/ui';
-import { Tabs, type TabsProps } from '@lobehub/ui';
+import { Block, Highlighter, Icon, Tabs, type TabsProps } from '@lobehub/ui';
import {
BracesIcon,
CircleAlertIcon,
diff --git a/src/features/Conversation/Messages/CompressedGroup/index.tsx b/src/features/Conversation/Messages/CompressedGroup/index.tsx
index 90af3520020..45cd86af82b 100644
--- a/src/features/Conversation/Messages/CompressedGroup/index.tsx
+++ b/src/features/Conversation/Messages/CompressedGroup/index.tsx
@@ -1,8 +1,17 @@
'use client';
import type { CompressionGroupMetadata, UIChatMessage } from '@lobechat/types';
-import { cx, Divider, Flexbox, Icon, Markdown } from '@lobehub/ui';
-import { ActionIcon, confirmModal, Tabs, type TabsItem } from '@lobehub/ui';
+import {
+ ActionIcon,
+ confirmModal,
+ cx,
+ Divider,
+ Flexbox,
+ Icon,
+ Markdown,
+ Tabs,
+ type TabsItem,
+} from '@lobehub/ui';
import { cssVar } from '@lobehub/ui/stylex/cssVar.stylex';
import * as stylex from '@stylexjs/stylex';
import isEqual from 'fast-deep-equal';
diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx b/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx
index 34df9aac590..c65a488cddc 100644
--- a/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx
+++ b/src/features/Conversation/Messages/GroupTasks/TaskItem/ClientTaskItem.tsx
@@ -17,8 +17,8 @@ import {
isProcessingStatus,
TaskMessages,
} from '../../Tasks/shared';
-import { type TaskMetrics } from './TaskTitle';
import TaskTitle from './TaskTitle';
+import { type TaskMetrics } from './TaskTitle';
interface ClientTaskItemProps {
item: UIChatMessage;
diff --git a/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx b/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx
index 2750c15c23a..22b11cc9351 100644
--- a/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx
+++ b/src/features/Conversation/Messages/GroupTasks/TaskItem/ServerTaskItem.tsx
@@ -10,8 +10,8 @@ import { useAgentGroupStore } from '@/store/agentGroup';
import { agentGroupSelectors } from '@/store/agentGroup/selectors';
import { TaskContent } from '../../Tasks/shared';
-import { type TaskMetrics } from './TaskTitle';
import TaskTitle from './TaskTitle';
+import { type TaskMetrics } from './TaskTitle';
interface ServerTaskItemProps {
item: UIChatMessage;
diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx b/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx
index b11b58f28a8..3fc0cca2915 100644
--- a/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx
+++ b/src/features/Conversation/Messages/Tasks/TaskItem/ClientTaskItem.tsx
@@ -10,8 +10,8 @@ import { type UIChatMessage } from '@/types/index';
import { ThreadStatus } from '@/types/index';
import { ErrorState, InitializingState, isProcessingStatus, TaskMessages } from '../shared';
-import { type TaskMetrics } from './TaskTitle';
import TaskTitle from './TaskTitle';
+import { type TaskMetrics } from './TaskTitle';
interface ClientTaskItemProps {
item: UIChatMessage;
diff --git a/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx b/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx
index 903544a8a00..2167784369a 100644
--- a/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx
+++ b/src/features/Conversation/Messages/Tasks/TaskItem/ServerTaskItem.tsx
@@ -7,8 +7,8 @@ import { type UIChatMessage } from '@/types/index';
import { ThreadStatus } from '@/types/index';
import { TaskContent } from '../shared';
-import { type TaskMetrics } from './TaskTitle';
import TaskTitle from './TaskTitle';
+import { type TaskMetrics } from './TaskTitle';
interface ServerTaskItemProps {
item: UIChatMessage;
diff --git a/src/features/Conversation/WorkingSidebar/Overview/OverviewRow.tsx b/src/features/Conversation/WorkingSidebar/Overview/OverviewRow.tsx
index 66ffba36f25..6c7f2198820 100644
--- a/src/features/Conversation/WorkingSidebar/Overview/OverviewRow.tsx
+++ b/src/features/Conversation/WorkingSidebar/Overview/OverviewRow.tsx
@@ -1,5 +1,4 @@
-import { Flexbox, Icon, type IconProps } from '@lobehub/ui';
-import { createStaticStyles, cx } from '@lobehub/ui';
+import { createStaticStyles, cx, Flexbox, Icon, type IconProps } from '@lobehub/ui';
import { ChevronRightIcon, ChevronsUpDownIcon } from 'lucide-react';
import { memo, type ReactNode } from 'react';
diff --git a/src/features/Conversation/WorkingSidebar/PullRequest/DockActionButton.tsx b/src/features/Conversation/WorkingSidebar/PullRequest/DockActionButton.tsx
index 146d5da334d..b6647f05ecd 100644
--- a/src/features/Conversation/WorkingSidebar/PullRequest/DockActionButton.tsx
+++ b/src/features/Conversation/WorkingSidebar/PullRequest/DockActionButton.tsx
@@ -3,8 +3,7 @@ import type {
DeviceGitPullRequestDetail,
DeviceGitPullRequestMergeMethod,
} from '@lobechat/types';
-import { Button, type DropdownItem, SplitButton } from '@lobehub/ui';
-import { createStaticStyles } from '@lobehub/ui';
+import { Button, createStaticStyles, type DropdownItem, SplitButton } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Conversation/WorkingSidebar/PullRequest/Header.tsx b/src/features/Conversation/WorkingSidebar/PullRequest/Header.tsx
index 83d251277a3..fef4c4136a5 100644
--- a/src/features/Conversation/WorkingSidebar/PullRequest/Header.tsx
+++ b/src/features/Conversation/WorkingSidebar/PullRequest/Header.tsx
@@ -1,6 +1,13 @@
import type { DeviceGitPullRequestAction, DeviceGitPullRequestDetail } from '@lobechat/types';
-import { copyToClipboard, cx, Icon } from '@lobehub/ui';
-import { ActionIcon, type DropdownItem, DropdownMenu, toast } from '@lobehub/ui';
+import {
+ ActionIcon,
+ copyToClipboard,
+ cx,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ toast,
+} from '@lobehub/ui';
import {
ArrowRightIcon,
ChevronDownIcon,
diff --git a/src/features/Conversation/WorkingSidebar/Review/index.tsx b/src/features/Conversation/WorkingSidebar/Review/index.tsx
index 724be41c1b3..13b2a87fe0f 100644
--- a/src/features/Conversation/WorkingSidebar/Review/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/Review/index.tsx
@@ -1,8 +1,16 @@
'use client';
import type { GitWorkingTreePatch } from '@lobechat/electron-client-ipc';
-import { Center, type DropdownItem, DropdownMenu, Empty, Flexbox } from '@lobehub/ui';
-import { ActionIcon, createStaticStyles, Spin } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Center,
+ createStaticStyles,
+ type DropdownItem,
+ DropdownMenu,
+ Empty,
+ Flexbox,
+ Spin,
+} from '@lobehub/ui';
import {
ArrowLeftIcon,
ChevronDownIcon,
diff --git a/src/features/Conversation/WorkingSidebar/index.tsx b/src/features/Conversation/WorkingSidebar/index.tsx
index ecb7d27aa23..ba342a01c4a 100644
--- a/src/features/Conversation/WorkingSidebar/index.tsx
+++ b/src/features/Conversation/WorkingSidebar/index.tsx
@@ -1,7 +1,15 @@
import { getWorkingDirEffectivePath } from '@lobechat/types';
import { nanoid } from '@lobechat/utils';
-import { ActionIcon, type DropdownItem, DropdownMenu, Flexbox, Icon, Skeleton } from '@lobehub/ui';
-import { createStaticStyles, cssVar } from '@lobehub/ui';
+import {
+ ActionIcon,
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ Skeleton,
+} from '@lobehub/ui';
import { SkillsIcon } from '@lobehub/ui/icons';
import {
BoxesIcon,
diff --git a/src/features/Dashboard/DashboardActionsMenu.tsx b/src/features/Dashboard/DashboardActionsMenu.tsx
index c37789ad013..67f434533dd 100644
--- a/src/features/Dashboard/DashboardActionsMenu.tsx
+++ b/src/features/Dashboard/DashboardActionsMenu.tsx
@@ -1,8 +1,14 @@
'use client';
import type { WidgetLevelFilter } from '@lobechat/types';
-import { Icon } from '@lobehub/ui';
-import { ActionIcon, confirmModal, type DropdownItem, DropdownMenu, toast } from '@lobehub/ui';
+import {
+ ActionIcon,
+ confirmModal,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ toast,
+} from '@lobehub/ui';
import { MoreHorizontalIcon, Settings2Icon, TrashIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Dashboard/WidgetPreview/AddToDashboardButton.tsx b/src/features/Dashboard/WidgetPreview/AddToDashboardButton.tsx
index afdf78fdefd..bdb0957da8b 100644
--- a/src/features/Dashboard/WidgetPreview/AddToDashboardButton.tsx
+++ b/src/features/Dashboard/WidgetPreview/AddToDashboardButton.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Icon } from '@lobehub/ui';
-import { Button, type DropdownItem, DropdownMenu, toast } from '@lobehub/ui';
+import { Button, type DropdownItem, DropdownMenu, Icon, toast } from '@lobehub/ui';
import { CheckIcon, LayoutDashboardIcon, PlusIcon } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/DataImporter/ImportDetail.tsx b/src/features/DataImporter/ImportDetail.tsx
index b18f7ef0941..5e325de47e3 100644
--- a/src/features/DataImporter/ImportDetail.tsx
+++ b/src/features/DataImporter/ImportDetail.tsx
@@ -1,7 +1,14 @@
'use client';
-import { createStaticStyles, Flexbox } from '@lobehub/ui';
-import { Button, ModalFooter, Table, type TableColumn, Text } from '@lobehub/ui';
+import {
+ Button,
+ createStaticStyles,
+ Flexbox,
+ ModalFooter,
+ Table,
+ type TableColumn,
+ Text,
+} from '@lobehub/ui';
import { Info } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/DataImporter/index.tsx b/src/features/DataImporter/index.tsx
index 2fa12703d94..b568b9ed339 100644
--- a/src/features/DataImporter/index.tsx
+++ b/src/features/DataImporter/index.tsx
@@ -4,8 +4,8 @@ import { type ErrorShape, type ImportFileUploadState } from '@lobechat/types';
import { ImportStage } from '@lobechat/types';
import { Button, Center, createStaticStyles, cx, toast, Upload } from '@lobehub/ui';
import { ImportIcon } from 'lucide-react';
-import { type ReactNode } from 'react';
import React, { memo, useCallback, useMemo, useState } from 'react';
+import { type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import DataStyleModal from '@/components/DataStyleModal';
diff --git a/src/features/DevDock/OverflowMenu.tsx b/src/features/DevDock/OverflowMenu.tsx
index 36a5e65c5ae..afd51190006 100644
--- a/src/features/DevDock/OverflowMenu.tsx
+++ b/src/features/DevDock/OverflowMenu.tsx
@@ -1,7 +1,6 @@
'use client';
-import { type DropdownItem, DropdownMenu } from '@lobehub/ui';
-import { createStaticStyles, cssVar, cx } from '@lobehub/ui';
+import { createStaticStyles, cssVar, cx, type DropdownItem, DropdownMenu } from '@lobehub/ui';
import { Ellipsis, Pin } from 'lucide-react';
import { memo } from 'react';
diff --git a/src/features/DevPanel/RenderGallery/Sidebar.tsx b/src/features/DevPanel/RenderGallery/Sidebar.tsx
index 874385d1316..affc74034b7 100644
--- a/src/features/DevPanel/RenderGallery/Sidebar.tsx
+++ b/src/features/DevPanel/RenderGallery/Sidebar.tsx
@@ -1,7 +1,6 @@
'use client';
-import { type DropdownItem, List, type ListItem, Text } from '@lobehub/ui';
-import { createStaticStyles } from '@lobehub/ui';
+import { createStaticStyles, type DropdownItem, List, type ListItem, Text } from '@lobehub/ui';
import { memo, useMemo } from 'react';
import { devDockPanelStyles } from '@/features/DevDock/panelStyles';
diff --git a/src/features/EditorCanvas/InternalEditor.test.tsx b/src/features/EditorCanvas/InternalEditor.test.tsx
index 508da253766..ffaff335312 100644
--- a/src/features/EditorCanvas/InternalEditor.test.tsx
+++ b/src/features/EditorCanvas/InternalEditor.test.tsx
@@ -8,8 +8,8 @@ import { act, cleanup, render, waitFor } from '@testing-library/react';
import { memo, useEffect, useRef } from 'react';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
-import { type InternalEditorProps } from './InternalEditor';
import InternalEditor from './InternalEditor';
+import { type InternalEditorProps } from './InternalEditor';
import { registerBlockDecoratorCaretGuard } from './registerBlockDecoratorCaretGuard';
vi.mock('./registerBlockDecoratorCaretGuard', () => ({
diff --git a/src/features/Electron/titlebar/TabBar/TabItem.tsx b/src/features/Electron/titlebar/TabBar/TabItem.tsx
index 0df52f50876..f4e33ac448a 100644
--- a/src/features/Electron/titlebar/TabBar/TabItem.tsx
+++ b/src/features/Electron/titlebar/TabBar/TabItem.tsx
@@ -1,7 +1,6 @@
'use client';
-import { ContextMenuTrigger, type DropdownItem, Icon, Tooltip } from '@lobehub/ui';
-import { ActionIcon, cx } from '@lobehub/ui';
+import { ActionIcon, ContextMenuTrigger, cx, type DropdownItem, Icon, Tooltip } from '@lobehub/ui';
import { X } from 'lucide-react';
import { type MotionValue, useMotionValue, useSpring, useTransform } from 'motion/react';
import * as m from 'motion/react-m';
diff --git a/src/features/FloatingChatPanel/InputRow.tsx b/src/features/FloatingChatPanel/InputRow.tsx
index 1e5024d2688..b4b2602d39f 100644
--- a/src/features/FloatingChatPanel/InputRow.tsx
+++ b/src/features/FloatingChatPanel/InputRow.tsx
@@ -56,7 +56,7 @@ const commitWithViewTransition = (commit: () => void) => {
const previousViewTransitionName = root.style.viewTransitionName;
root.style.viewTransitionName = 'none';
const transition = (document as DocumentWithVT).startViewTransition!(() => {
- // eslint-disable-next-line @eslint-react/dom/no-flush-sync
+ // eslint-disable-next-line @eslint-react/dom-no-flush-sync
flushSync(commit);
});
const restore = () => {
diff --git a/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx b/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx
index 0f5ee5a53a0..45bbf18321f 100644
--- a/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx
+++ b/src/features/HomeSidebar/Body/CustomizeSidebarModal.tsx
@@ -20,13 +20,18 @@ import {
verticalListSortingStrategy,
} from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
-import { createStaticStyles, cssVar, cx, Flexbox, Icon, Tooltip } from '@lobehub/ui';
import {
ActionIcon,
Button,
createModal,
+ createStaticStyles,
+ cssVar,
+ cx,
+ Flexbox,
+ Icon,
type ModalInstance,
Text,
+ Tooltip,
useModalContext,
} from '@lobehub/ui';
import { t } from 'i18next';
diff --git a/src/features/HomeSidebar/Header/components/Nav.tsx b/src/features/HomeSidebar/Header/components/Nav.tsx
index 2c021ebdc3a..12da5815097 100644
--- a/src/features/HomeSidebar/Header/components/Nav.tsx
+++ b/src/features/HomeSidebar/Header/components/Nav.tsx
@@ -4,8 +4,8 @@ import { Flexbox, Tag } from '@lobehub/ui';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import { type NavItemProps } from '@/features/NavPanel/components/NavItem';
import NavItem from '@/features/NavPanel/components/NavItem';
+import { type NavItemProps } from '@/features/NavPanel/components/NavItem';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import WorkspaceLink from '@/features/Workspace/WorkspaceLink';
import { useActiveTabKey } from '@/hooks/useActiveTabKey';
diff --git a/src/features/HomeSidebar/hooks/useCreateModal.tsx b/src/features/HomeSidebar/hooks/useCreateModal.tsx
index ef3dc558eed..b06120ca958 100644
--- a/src/features/HomeSidebar/hooks/useCreateModal.tsx
+++ b/src/features/HomeSidebar/hooks/useCreateModal.tsx
@@ -1,5 +1,13 @@
-import { Block, cssVar, Flexbox } from '@lobehub/ui';
-import { ActionIcon, Button, createModal, type ModalInstance, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Block,
+ Button,
+ createModal,
+ cssVar,
+ Flexbox,
+ type ModalInstance,
+ Text,
+} from '@lobehub/ui';
import { Blocks, CheckCircle2, Lightbulb, PencilLineIcon, RefreshCw, X } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/LibraryModal/AssignKnowledgeBase/List.tsx b/src/features/LibraryModal/AssignKnowledgeBase/List.tsx
index 03953969c4f..ae22e5ce87b 100644
--- a/src/features/LibraryModal/AssignKnowledgeBase/List.tsx
+++ b/src/features/LibraryModal/AssignKnowledgeBase/List.tsx
@@ -16,8 +16,8 @@ import Loading from './Loading';
import MasonrySkeleton from './MasonrySkeleton';
import { resolvePickerScope } from './resolvePickerScope';
import { useViewTransition } from './useViewTransition';
-import { type ViewMode } from './ViewSwitcher';
import ViewSwitcher from './ViewSwitcher';
+import { type ViewMode } from './ViewSwitcher';
import VisibilityTabs, { type PickerVisibility } from './VisibilityTabs';
/** Stable empty list so an un-loaded surface never hands Virtuoso a new array each render. */
diff --git a/src/features/LibraryModal/AssignKnowledgeBase/index.tsx b/src/features/LibraryModal/AssignKnowledgeBase/index.tsx
index 6f59f534777..ea41fa2c94b 100644
--- a/src/features/LibraryModal/AssignKnowledgeBase/index.tsx
+++ b/src/features/LibraryModal/AssignKnowledgeBase/index.tsx
@@ -1,5 +1,4 @@
-import { Flexbox } from '@lobehub/ui';
-import { createModal, type ModalInstance } from '@lobehub/ui';
+import { createModal, Flexbox, type ModalInstance } from '@lobehub/ui';
import { t } from 'i18next';
import { memo } from 'react';
diff --git a/src/features/LibraryModal/FilePicker/index.tsx b/src/features/LibraryModal/FilePicker/index.tsx
index 1703b6e712d..0f17fa3c026 100644
--- a/src/features/LibraryModal/FilePicker/index.tsx
+++ b/src/features/LibraryModal/FilePicker/index.tsx
@@ -27,8 +27,8 @@ import type { ResourceItem } from '@/types/resource';
import Item from '../AssignKnowledgeBase/Item';
import MasonryItem from '../AssignKnowledgeBase/Item/MasonryItem';
import Loading from '../AssignKnowledgeBase/Loading';
-import { type ViewMode } from '../AssignKnowledgeBase/ViewSwitcher';
import ViewSwitcher from '../AssignKnowledgeBase/ViewSwitcher';
+import { type ViewMode } from '../AssignKnowledgeBase/ViewSwitcher';
const PAGE_SIZE = 50;
diff --git a/src/features/MCP/MCPSettings/McpSettingsModal.tsx b/src/features/MCP/MCPSettings/McpSettingsModal.tsx
index caea292f899..7fdfe146fc3 100644
--- a/src/features/MCP/MCPSettings/McpSettingsModal.tsx
+++ b/src/features/MCP/MCPSettings/McpSettingsModal.tsx
@@ -4,8 +4,8 @@ import { Button, createModal, Flexbox, ModalFooter } from '@lobehub/ui';
import { t as i18nT } from 'i18next';
import { type RefObject } from 'react';
-import { type SettingsRef } from './index';
import Settings from './index';
+import { type SettingsRef } from './index';
interface McpSettingsModalOptions {
identifier: string;
diff --git a/src/features/MCPPluginDetail/Agents.tsx b/src/features/MCPPluginDetail/Agents.tsx
index 42fff30531c..4a8a5fee575 100644
--- a/src/features/MCPPluginDetail/Agents.tsx
+++ b/src/features/MCPPluginDetail/Agents.tsx
@@ -23,6 +23,8 @@ interface AgentsProps {
inModal?: boolean;
}
+const FooterSpacer = () => <div style={{ height: 16 }} />;
+
const Agents = memo<AgentsProps>(({ inModal }) => {
const { t } = useTranslation('discover');
const { identifier } = useDetailContext();
@@ -111,7 +113,7 @@ const Agents = memo<AgentsProps>(({ inModal }) => {
style={inModal ? { height: '50vh', width: '100%' } : { width: '100%' }}
useWindowScroll={!inModal}
components={{
- Footer: isLoading ? VirtuosoLoading : () => <div style={{ height: 16 }} />,
+ Footer: isLoading ? VirtuosoLoading : FooterSpacer,
}}
/>
);
diff --git a/src/features/MCPPluginDetail/CollapseLayout.tsx b/src/features/MCPPluginDetail/CollapseLayout.tsx
index 07da304f60d..08e12cd68c6 100644
--- a/src/features/MCPPluginDetail/CollapseLayout.tsx
+++ b/src/features/MCPPluginDetail/CollapseLayout.tsx
@@ -2,8 +2,8 @@ import { Flexbox } from '@lobehub/ui';
import { type ReactNode } from 'react';
import { memo } from 'react';
-import { type TitleProps } from '@/routes/(main)/community/features/Title';
import Title from '@/routes/(main)/community/features/Title';
+import { type TitleProps } from '@/routes/(main)/community/features/Title';
export type CollapseItemType = {
children: ReactNode;
diff --git a/src/features/MCPPluginDetail/Nav.tsx b/src/features/MCPPluginDetail/Nav.tsx
index 260a5fde47a..4fdd60a1448 100644
--- a/src/features/MCPPluginDetail/Nav.tsx
+++ b/src/features/MCPPluginDetail/Nav.tsx
@@ -1,8 +1,7 @@
'use client';
import { SOCIAL_URL } from '@lobechat/business-const';
-import { createStaticStyles, Flexbox, Icon } from '@lobehub/ui';
-import { Tabs, type TabsItem, Tag } from '@lobehub/ui';
+import { createStaticStyles, Flexbox, Icon, Tabs, type TabsItem, Tag } from '@lobehub/ui';
import {
BookOpenIcon,
BotIcon,
diff --git a/src/features/MCPPluginDetail/Score/ScoreList.tsx b/src/features/MCPPluginDetail/Score/ScoreList.tsx
index 1b037b0f49b..cc1030cd2d7 100644
--- a/src/features/MCPPluginDetail/Score/ScoreList.tsx
+++ b/src/features/MCPPluginDetail/Score/ScoreList.tsx
@@ -1,8 +1,8 @@
import { Divider, Flexbox } from '@lobehub/ui';
import { Fragment, memo } from 'react';
-import { type ScoreItemProps } from './ScoreItem';
import ScoreItem from './ScoreItem';
+import { type ScoreItemProps } from './ScoreItem';
interface ScoreListProps {
items: ScoreItemProps[];
diff --git a/src/features/MemoryRules/DetailPanel.tsx b/src/features/MemoryRules/DetailPanel.tsx
index 540bcbed2e4..14492f2b583 100644
--- a/src/features/MemoryRules/DetailPanel.tsx
+++ b/src/features/MemoryRules/DetailPanel.tsx
@@ -5,12 +5,17 @@ import {
type ExpertiseEnforcement,
type ExpertiseReasonKind,
} from '@lobechat/types';
-import { Block, createStaticStyles, cssVar, cx, Flexbox, Icon } from '@lobehub/ui';
import {
ActionIcon,
+ Block,
Button,
+ createStaticStyles,
+ cssVar,
+ cx,
type DropdownItem,
DropdownMenu,
+ Flexbox,
+ Icon,
SkeletonText,
Tag,
Text,
diff --git a/src/features/MemoryRules/GroupSection.tsx b/src/features/MemoryRules/GroupSection.tsx
index 473079b46c3..ea9b56ad1e5 100644
--- a/src/features/MemoryRules/GroupSection.tsx
+++ b/src/features/MemoryRules/GroupSection.tsx
@@ -1,7 +1,14 @@
'use client';
-import { cx, Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, type DropdownItem, DropdownMenu, Tooltip } from '@lobehub/ui';
+import {
+ ActionIcon,
+ cx,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ Tooltip,
+} from '@lobehub/ui';
import { ChevronRightIcon, MoreHorizontalIcon, PlusIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/MemoryRules/RuleRow.tsx b/src/features/MemoryRules/RuleRow.tsx
index bd59dd05b2b..86eebe122e8 100644
--- a/src/features/MemoryRules/RuleRow.tsx
+++ b/src/features/MemoryRules/RuleRow.tsx
@@ -1,8 +1,16 @@
'use client';
import type { ExpertiseEnforcement, ExpertiseRuleDirection } from '@lobechat/types';
-import { cx, Flexbox, SortableList } from '@lobehub/ui';
-import { ActionIcon, type DropdownItem, DropdownMenu, Tag, Tooltip } from '@lobehub/ui';
+import {
+ ActionIcon,
+ cx,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ SortableList,
+ Tag,
+ Tooltip,
+} from '@lobehub/ui';
import dayjs from 'dayjs';
import { MoreHorizontalIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Messenger/AgentSelect.tsx b/src/features/Messenger/AgentSelect.tsx
index c1d6b8f035d..bb93a2d0026 100644
--- a/src/features/Messenger/AgentSelect.tsx
+++ b/src/features/Messenger/AgentSelect.tsx
@@ -1,8 +1,7 @@
'use client';
import { agentDisplayName } from '@lobechat/types';
-import { Flexbox } from '@lobehub/ui';
-import { Select, type SelectProps, Text } from '@lobehub/ui';
+import { Flexbox, Select, type SelectProps, Text } from '@lobehub/ui';
import { memo, useEffect, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';
import useSWR from 'swr';
diff --git a/src/features/MobileHome/SessionListContent/List/Item/Actions.tsx b/src/features/MobileHome/SessionListContent/List/Item/Actions.tsx
index 45486591bea..067b8bfb960 100644
--- a/src/features/MobileHome/SessionListContent/List/Item/Actions.tsx
+++ b/src/features/MobileHome/SessionListContent/List/Item/Actions.tsx
@@ -1,6 +1,12 @@
import { type SidebarAgentItem } from '@lobechat/types';
-import { type DropdownItem, Icon, toast } from '@lobehub/ui';
-import { ActionIcon, confirmModal, DropdownMenu } from '@lobehub/ui';
+import {
+ ActionIcon,
+ confirmModal,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ toast,
+} from '@lobehub/ui';
import { Check, Copy, ListTree, MoreVertical, Pin, PinOff, Plus, Trash } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ModelSelect/index.tsx b/src/features/ModelSelect/index.tsx
index f1361b4e7b7..71c2f5fdda1 100644
--- a/src/features/ModelSelect/index.tsx
+++ b/src/features/ModelSelect/index.tsx
@@ -1,5 +1,16 @@
-import { createStaticStyles, Flexbox, Tooltip, TooltipGroup } from '@lobehub/ui';
-import { Button, Select, type SelectProps, Switch, Tag, Text, toast } from '@lobehub/ui';
+import {
+ Button,
+ createStaticStyles,
+ Flexbox,
+ Select,
+ type SelectProps,
+ Switch,
+ Tag,
+ Text,
+ toast,
+ Tooltip,
+ TooltipGroup,
+} from '@lobehub/ui';
import { type ReactNode } from 'react';
import { memo, useCallback, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/NavPanel/SideBarHeaderLayout.tsx b/src/features/NavPanel/SideBarHeaderLayout.tsx
index a946d96fa11..3f95a06a317 100644
--- a/src/features/NavPanel/SideBarHeaderLayout.tsx
+++ b/src/features/NavPanel/SideBarHeaderLayout.tsx
@@ -1,7 +1,13 @@
'use client';
-import { createStaticStyles, Flexbox, Icon } from '@lobehub/ui';
-import { Breadcrumb, type BreadcrumbItem, Text } from '@lobehub/ui';
+import {
+ Breadcrumb,
+ type BreadcrumbItem,
+ createStaticStyles,
+ Flexbox,
+ Icon,
+ Text,
+} from '@lobehub/ui';
import { ChevronRightIcon, HomeIcon } from 'lucide-react';
import type { ReactNode } from 'react';
import { memo } from 'react';
@@ -92,7 +98,7 @@ const SideBarHeaderLayout = memo<SideBarHeaderLayoutProps>(
if (href) {
event.preventDefault();
event.stopPropagation();
- // eslint-disable-next-line @eslint-react/dom/no-flush-sync
+ // eslint-disable-next-line @eslint-react/dom-no-flush-sync
flushSync(() => navigate(href));
}
},
diff --git a/src/features/OpenInAppButton/index.tsx b/src/features/OpenInAppButton/index.tsx
index e09144dfb88..f1e7e56983d 100644
--- a/src/features/OpenInAppButton/index.tsx
+++ b/src/features/OpenInAppButton/index.tsx
@@ -1,7 +1,13 @@
import { isDesktop } from '@lobechat/const';
import type { OpenInAppId } from '@lobechat/electron-client-ipc';
-import { DropdownMenu, type DropdownMenuProps, Icon, Tooltip } from '@lobehub/ui';
-import { createStaticStyles, cssVar } from '@lobehub/ui';
+import {
+ createStaticStyles,
+ cssVar,
+ DropdownMenu,
+ type DropdownMenuProps,
+ Icon,
+ Tooltip,
+} from '@lobehub/ui';
import { ChevronDownIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/PageEditor/EditorCanvas/index.tsx b/src/features/PageEditor/EditorCanvas/index.tsx
index 05951d14bfe..4299da0a09a 100644
--- a/src/features/PageEditor/EditorCanvas/index.tsx
+++ b/src/features/PageEditor/EditorCanvas/index.tsx
@@ -2,8 +2,7 @@
import { ReactBlockPlugin, ReactCollapsiblePlugin } from '@lobehub/editor';
import { Editor } from '@lobehub/editor/react';
-import { type CSSProperties, useMemo } from 'react';
-import { memo } from 'react';
+import { type CSSProperties, memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { mentionPlainClassName } from '@/features/ChatInput/InputEditor/mentionStyle';
diff --git a/src/features/PageEditor/History/index.tsx b/src/features/PageEditor/History/index.tsx
index 790d01d211e..c659e1cfd08 100644
--- a/src/features/PageEditor/History/index.tsx
+++ b/src/features/PageEditor/History/index.tsx
@@ -1,7 +1,16 @@
'use client';
-import { createStaticStyles, cssVar, Empty, Flexbox } from '@lobehub/ui';
-import { Button, confirmModal, type ModalInstance, Text, toast } from '@lobehub/ui';
+import {
+ Button,
+ confirmModal,
+ createStaticStyles,
+ cssVar,
+ Empty,
+ Flexbox,
+ type ModalInstance,
+ Text,
+ toast,
+} from '@lobehub/ui';
import dayjs from 'dayjs';
import { ArrowLeftIcon, Clock3Icon } from 'lucide-react';
import { memo, useMemo, useRef, useState } from 'react';
diff --git a/src/features/PageEditor/PageEditorProvider.tsx b/src/features/PageEditor/PageEditorProvider.tsx
index b9ef7f8859d..e574febec8d 100644
--- a/src/features/PageEditor/PageEditorProvider.tsx
+++ b/src/features/PageEditor/PageEditorProvider.tsx
@@ -5,8 +5,8 @@ import { type ReactNode } from 'react';
import { memo } from 'react';
import { createStore, Provider } from './store';
-import { type StoreUpdaterProps } from './StoreUpdater';
import StoreUpdater from './StoreUpdater';
+import { type StoreUpdaterProps } from './StoreUpdater';
interface PageEditorProviderProps extends StoreUpdaterProps {
children: ReactNode;
diff --git a/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx b/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx
index c2d598ec34a..78c97280986 100644
--- a/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx
+++ b/src/features/PluginDevModal/MCPManifestForm/ArgsInput.tsx
@@ -1,5 +1,4 @@
-import { Flexbox } from '@lobehub/ui';
-import { ActionIcon, Button, Input, type InputProps } from '@lobehub/ui';
+import { ActionIcon, Button, Flexbox, Input, type InputProps } from '@lobehub/ui';
import { Plus, X } from 'lucide-react';
import React, { memo, useCallback } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Portal/LocalFile/PathBreadcrumb.tsx b/src/features/Portal/LocalFile/PathBreadcrumb.tsx
index 5cdc34111d4..30f5844781b 100644
--- a/src/features/Portal/LocalFile/PathBreadcrumb.tsx
+++ b/src/features/Portal/LocalFile/PathBreadcrumb.tsx
@@ -1,8 +1,15 @@
'use client';
import type { ProjectFileIndexEntry } from '@lobechat/electron-client-ipc';
-import { type DropdownItem, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { createStaticStyles, cssVar, cx } from '@lobehub/ui';
+import {
+ createStaticStyles,
+ cssVar,
+ cx,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+} from '@lobehub/ui';
import { ChevronRightIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
diff --git a/src/features/Portal/components/Header.tsx b/src/features/Portal/components/Header.tsx
index 7218da698eb..a69cfa9982b 100644
--- a/src/features/Portal/components/Header.tsx
+++ b/src/features/Portal/components/Header.tsx
@@ -7,8 +7,7 @@ import {
} from '@lobechat/const';
import { ActionIcon, Flexbox } from '@lobehub/ui';
import { ArrowLeft, X } from 'lucide-react';
-import { type CSSProperties, Fragment, type ReactNode } from 'react';
-import { memo } from 'react';
+import { type CSSProperties, Fragment, memo, type ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { useLocation, useParams } from 'react-router';
diff --git a/src/features/Projects/List/index.tsx b/src/features/Projects/List/index.tsx
index fe46ce34d2d..78def98434a 100644
--- a/src/features/Projects/List/index.tsx
+++ b/src/features/Projects/List/index.tsx
@@ -2,24 +2,22 @@
import { agentDisplayName } from '@lobechat/types';
import {
+ ActionIcon,
+ Button,
Center,
+ confirmModal,
ContextMenuTrigger,
createStaticStyles,
cssVar,
+ type DropdownItem,
+ DropdownMenu,
Empty,
Flexbox,
Icon,
SearchBar,
- Tooltip,
-} from '@lobehub/ui';
-import {
- ActionIcon,
- Button,
- confirmModal,
- type DropdownItem,
- DropdownMenu,
Text,
toast,
+ Tooltip,
} from '@lobehub/ui';
import dayjs from 'dayjs';
import {
diff --git a/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx b/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx
index 0aa59a4b76d..41b27e3920b 100644
--- a/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx
+++ b/src/features/RecommendTaskTemplates/TaskTemplateDetailModal.tsx
@@ -1,12 +1,15 @@
'use client';
import type { TaskTemplate } from '@lobechat/const';
-import { cssVar, Flexbox, Icon, Markdown } from '@lobehub/ui';
import {
ActionIcon,
Button,
createModal,
+ cssVar,
Divider,
+ Flexbox,
+ Icon,
+ Markdown,
type ModalInstance,
Text,
useModalContext,
diff --git a/src/features/Recommendations/actions/registry.ts b/src/features/Recommendations/actions/registry.ts
index 31ed8f205e7..8a330e12866 100644
--- a/src/features/Recommendations/actions/registry.ts
+++ b/src/features/Recommendations/actions/registry.ts
@@ -10,6 +10,5 @@ import type { RecommendedAction } from './types';
* Recommendations container filters this list against the current
* {@link ActionContext} and renders the surviving entries.
*/
-export const recommendedActionsRegistry: RecommendedAction[] = [
- ...HETEROGENEOUS_AGENT_CLIENT_CONFIGS.map(buildHeteroAgentAction),
-];
+export const recommendedActionsRegistry: RecommendedAction[] =
+ HETEROGENEOUS_AGENT_CLIENT_CONFIGS.map(buildHeteroAgentAction);
diff --git a/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx
index 7c7031e02c4..24b69b208a7 100644
--- a/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx
+++ b/src/features/ResourceHome/Layout/Body/LibraryList/Item/index.tsx
@@ -1,6 +1,6 @@
import { cssVar, Spin } from '@lobehub/ui';
-import { type CSSProperties } from 'react';
import React, { memo, useCallback, useMemo } from 'react';
+import { type CSSProperties } from 'react';
import LibraryStatusIcon from '@/components/LibIcon/StatusIcon';
import NavItem from '@/features/NavPanel/components/NavItem';
diff --git a/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx b/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx
index 6d1a8066490..72fc28d30fe 100644
--- a/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx
+++ b/src/features/ResourceManager/components/Explorer/MoveToFolderModal.tsx
@@ -13,8 +13,8 @@ import { FolderIcon } from 'lucide-react';
import { memo, useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
-import { type FolderTreeItem } from '@/features/ResourceManager/components/FolderTree';
import FolderTree from '@/features/ResourceManager/components/FolderTree';
+import { type FolderTreeItem } from '@/features/ResourceManager/components/FolderTree';
import { fileService } from '@/services/file';
import { useFileStore } from '@/store/file';
import { useTreeStore } from '@/store/tree';
diff --git a/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx b/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx
index 802e99e87ed..0e5172b9340 100644
--- a/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx
+++ b/src/features/ResourceManager/components/LibraryHierarchy/FolderAddButton.tsx
@@ -6,8 +6,15 @@ import {
DERIVED_DOCUMENT_SOURCE_TYPE,
} from '@lobechat/const';
import { Notion } from '@lobehub/icons';
-import { type DropdownItem, DropdownMenu, Icon, stopPropagation } from '@lobehub/ui';
-import { ActionIcon, toast, Upload } from '@lobehub/ui';
+import {
+ ActionIcon,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ stopPropagation,
+ toast,
+ Upload,
+} from '@lobehub/ui';
import { FilePenLine, FileUp, FolderIcon, FolderUp, Link, Plus } from 'lucide-react';
import { type ChangeEvent } from 'react';
import { memo, useCallback, useId, useMemo, useState } from 'react';
diff --git a/src/features/ResourceManager/components/ResourceModeToggle/index.tsx b/src/features/ResourceManager/components/ResourceModeToggle/index.tsx
index 12174195d6f..ee4faee5816 100644
--- a/src/features/ResourceManager/components/ResourceModeToggle/index.tsx
+++ b/src/features/ResourceManager/components/ResourceModeToggle/index.tsx
@@ -1,7 +1,13 @@
'use client';
-import { type DropdownItem, DropdownMenu, Icon, type MenuInfo } from '@lobehub/ui';
-import { ActionIcon, cssVar } from '@lobehub/ui';
+import {
+ ActionIcon,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Icon,
+ type MenuInfo,
+} from '@lobehub/ui';
import { CheckIcon, LockIcon, UsersIcon } from 'lucide-react';
import { memo, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/ResourceManager/store/selectors.ts b/src/features/ResourceManager/store/selectors.ts
index e4aecd36dac..15599f3f133 100644
--- a/src/features/ResourceManager/store/selectors.ts
+++ b/src/features/ResourceManager/store/selectors.ts
@@ -1,6 +1,5 @@
import { fileManagerSelectors, useFileStore } from '@/store/file';
-import { type FileListItem, FilesTabs, ResourceSourceFilter } from '@/types/files';
-import { SortType } from '@/types/files';
+import { type FileListItem, FilesTabs, ResourceSourceFilter, SortType } from '@/types/files';
import type { ResourceListVisibilityFilter, SelectAllState, State } from './initialState';
import { DEFAULT_SEARCH_PAGE_SIZE, type ExplorerSearchParams } from './projection';
diff --git a/src/features/RightPanel/index.tsx b/src/features/RightPanel/index.tsx
index b13dd9253cc..b0da1d80630 100644
--- a/src/features/RightPanel/index.tsx
+++ b/src/features/RightPanel/index.tsx
@@ -1,5 +1,4 @@
-import { DraggablePanel, type DraggablePanelProps, Drawer } from '@lobehub/ui';
-import { cssVar } from '@lobehub/ui';
+import { cssVar, DraggablePanel, type DraggablePanelProps, Drawer } from '@lobehub/ui';
import { memo, Suspense, useState } from 'react';
import SurfaceSkeleton from '@/components/Skeleton/Surface';
diff --git a/src/features/Settings/apikey/features/ApiKey.tsx b/src/features/Settings/apikey/features/ApiKey.tsx
index 92407aebdcc..67dfab6708a 100644
--- a/src/features/Settings/apikey/features/ApiKey.tsx
+++ b/src/features/Settings/apikey/features/ApiKey.tsx
@@ -23,8 +23,8 @@ import { useTranslation } from 'react-i18next';
import urlJoin from 'url-join';
import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
-import { type LiteTableColumn } from '@/components/LiteTable';
import LiteTable from '@/components/LiteTable';
+import { type LiteTableColumn } from '@/components/LiteTable';
import { isFullAccessApiKey } from '@/const/apiKeyScope';
import { usePermission } from '@/hooks/usePermission';
import { useClientDataSWR } from '@/libs/swr';
diff --git a/src/features/Settings/apikey/features/ApiKeyDatePicker/index.tsx b/src/features/Settings/apikey/features/ApiKeyDatePicker/index.tsx
index a912fc8e2a3..53a533db22c 100644
--- a/src/features/Settings/apikey/features/ApiKeyDatePicker/index.tsx
+++ b/src/features/Settings/apikey/features/ApiKeyDatePicker/index.tsx
@@ -1,10 +1,10 @@
-import { Flexbox } from '@lobehub/ui';
import {
DayjsDatePicker as DatePicker,
type DayjsDatePickerProps as DatePickerProps,
+ Flexbox,
} from '@lobehub/ui';
-import { type Dayjs } from 'dayjs';
import dayjs from 'dayjs';
+import { type Dayjs } from 'dayjs';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Settings/apikey/features/ApiKeyModal/Content.tsx b/src/features/Settings/apikey/features/ApiKeyModal/Content.tsx
index 80aa126f928..33a2fc4bb59 100644
--- a/src/features/Settings/apikey/features/ApiKeyModal/Content.tsx
+++ b/src/features/Settings/apikey/features/ApiKeyModal/Content.tsx
@@ -12,8 +12,8 @@ import {
useModalContext,
} from '@lobehub/ui';
import { Form, useForm } from '@lobehub/ui/form';
-import { type Dayjs } from 'dayjs';
import dayjs from 'dayjs';
+import { type Dayjs } from 'dayjs';
import { CheckCircle2 } from 'lucide-react';
import { type FC, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Settings/apikey/features/EditableCell/index.tsx b/src/features/Settings/apikey/features/EditableCell/index.tsx
index 77e2dfa1b97..237d4cdc451 100644
--- a/src/features/Settings/apikey/features/EditableCell/index.tsx
+++ b/src/features/Settings/apikey/features/EditableCell/index.tsx
@@ -1,8 +1,8 @@
'use client';
import { ActionIcon, createStaticStyles, cx, Input, toast } from '@lobehub/ui';
-import { type Dayjs } from 'dayjs';
import dayjs from 'dayjs';
+import { type Dayjs } from 'dayjs';
import { Check, Edit, X } from 'lucide-react';
import React, { memo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Settings/appearance/features/Font/FallbackFontList.tsx b/src/features/Settings/appearance/features/Font/FallbackFontList.tsx
index f5c6b031073..f5db2cf85f5 100644
--- a/src/features/Settings/appearance/features/Font/FallbackFontList.tsx
+++ b/src/features/Settings/appearance/features/Font/FallbackFontList.tsx
@@ -1,7 +1,15 @@
'use client';
-import { createStaticStyles, Flexbox, SortableList } from '@lobehub/ui';
-import { ActionIcon, Button, Select, type SelectOption, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Button,
+ createStaticStyles,
+ Flexbox,
+ Select,
+ type SelectOption,
+ SortableList,
+ Text,
+} from '@lobehub/ui';
import { PlusIcon, XIcon } from 'lucide-react';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/Settings/provider/ProviderMenu/List.tsx b/src/features/Settings/provider/ProviderMenu/List.tsx
index a453306a911..555e9c6daad 100644
--- a/src/features/Settings/provider/ProviderMenu/List.tsx
+++ b/src/features/Settings/provider/ProviderMenu/List.tsx
@@ -1,6 +1,5 @@
'use client';
-import { ContextMenuTrigger, type DropdownItem, Flexbox } from '@lobehub/ui';
import {
AccordionHeader,
AccordionItem,
@@ -9,7 +8,10 @@ import {
accordionStyles,
AccordionTrigger,
ActionIcon,
+ ContextMenuTrigger,
cx,
+ type DropdownItem,
+ Flexbox,
Text,
} from '@lobehub/ui';
import isEqual from 'fast-deep-equal';
diff --git a/src/features/Settings/provider/detail/default/index.tsx b/src/features/Settings/provider/detail/default/index.tsx
index 7706d5afe3c..fcbfdacb7e6 100644
--- a/src/features/Settings/provider/detail/default/index.tsx
+++ b/src/features/Settings/provider/detail/default/index.tsx
@@ -7,8 +7,8 @@ import { useAiInfraStore } from '@/store/aiInfra';
import { useServerConfigStore } from '@/store/serverConfig';
import ModelList from '../../features/ModelList';
-import { type ProviderConfigProps } from '../../features/ProviderConfig';
import ProviderConfig from '../../features/ProviderConfig';
+import { type ProviderConfigProps } from '../../features/ProviderConfig';
interface ProviderDetailProps extends ProviderConfigProps {
showConfig?: boolean;
diff --git a/src/features/Settings/provider/features/CreateNewProvider/index.tsx b/src/features/Settings/provider/features/CreateNewProvider/index.tsx
index 8de2c1176de..2516efdc076 100644
--- a/src/features/Settings/provider/features/CreateNewProvider/index.tsx
+++ b/src/features/Settings/provider/features/CreateNewProvider/index.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Flexbox, Icon } from '@lobehub/ui';
-import { createModal, type ModalInstance } from '@lobehub/ui';
+import { createModal, Flexbox, Icon, type ModalInstance } from '@lobehub/ui';
import { t } from 'i18next';
import { BrainIcon } from 'lucide-react';
diff --git a/src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx b/src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx
index b0f51f6beee..6e001b9615e 100644
--- a/src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx
+++ b/src/features/Settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx
@@ -1,10 +1,12 @@
'use client';
-import { cssVar, Flexbox, Icon } from '@lobehub/ui';
import {
Button,
confirmModal,
createModal,
+ cssVar,
+ Flexbox,
+ Icon,
Input,
ModalFooter,
type ModalInstance,
diff --git a/src/features/Settings/provider/features/ProviderConfig/index.tsx b/src/features/Settings/provider/features/ProviderConfig/index.tsx
index 9ba4d408ebb..386c34c06db 100644
--- a/src/features/Settings/provider/features/ProviderConfig/index.tsx
+++ b/src/features/Settings/provider/features/ProviderConfig/index.tsx
@@ -50,8 +50,8 @@ import { AiProviderSourceEnum } from '@/types/aiProvider';
import { KeyVaultsConfigKey, LLMProviderApiTokenKey, LLMProviderBaseUrlKey } from '../../const';
import { isResponsesApiSupportedSdkType } from '../providerSettings';
-import { type CheckErrorRender } from './Checker';
import Checker from './Checker';
+import { type CheckErrorRender } from './Checker';
import EnableSwitch from './EnableSwitch';
import OAuthDeviceFlowAuth from './OAuthDeviceFlowAuth';
import UpdateProviderInfo from './UpdateProviderInfo';
diff --git a/src/features/Settings/trash/features/ProjectFilter.tsx b/src/features/Settings/trash/features/ProjectFilter.tsx
index 2de7aad9033..e6248aaa142 100644
--- a/src/features/Settings/trash/features/ProjectFilter.tsx
+++ b/src/features/Settings/trash/features/ProjectFilter.tsx
@@ -1,8 +1,16 @@
'use client';
import type { TrashProjectFilter } from '@lobechat/types';
-import { createStaticStyles, cssVar, Flexbox, Icon } from '@lobehub/ui';
-import { controlHeight, Select, type SelectOptions, Text } from '@lobehub/ui';
+import {
+ controlHeight,
+ createStaticStyles,
+ cssVar,
+ Flexbox,
+ Icon,
+ Select,
+ type SelectOptions,
+ Text,
+} from '@lobehub/ui';
import { FolderKanbanIcon, LockIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/SkillStore/SkillDetail/Agents.tsx b/src/features/SkillStore/SkillDetail/Agents.tsx
index 96641f65aa1..896cf75a95f 100644
--- a/src/features/SkillStore/SkillDetail/Agents.tsx
+++ b/src/features/SkillStore/SkillDetail/Agents.tsx
@@ -19,6 +19,8 @@ import VirtuosoLoading from './VirtuosoLoading';
const PAGE_SIZE = 12;
+const FooterSpacer = () => <div style={{ height: 16 }} />;
+
const Agents = memo(() => {
const { t } = useTranslation('plugin');
const { identifier } = useDetailContext();
@@ -106,7 +108,7 @@ const Agents = memo(() => {
overscan={24}
style={{ height: '50vh', width: '100%' }}
components={{
- Footer: isLoading ? VirtuosoLoading : () => <div style={{ height: 16 }} />,
+ Footer: isLoading ? VirtuosoLoading : FooterSpacer,
}}
/>
);
diff --git a/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx b/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx
index e2cf02bb888..8cec40b10d8 100644
--- a/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx
+++ b/src/features/SkillStore/SkillDetail/SkillDetailInner.tsx
@@ -7,8 +7,8 @@ import { ArticleSkeleton } from '@/components/Skeleton';
import Agents from './Agents';
import Header from './Header';
-import { type TabKey } from './Nav';
import Nav from './Nav';
+import { type TabKey } from './Nav';
import Overview from './Overview';
const Schema = lazy(() => import('./Schema'));
diff --git a/src/features/SkillStore/SkillList/ImportFromGithubModal.tsx b/src/features/SkillStore/SkillList/ImportFromGithubModal.tsx
index 2e505caa8c6..94fe7d4d829 100644
--- a/src/features/SkillStore/SkillList/ImportFromGithubModal.tsx
+++ b/src/features/SkillStore/SkillList/ImportFromGithubModal.tsx
@@ -1,10 +1,11 @@
'use client';
-import { Flexbox, Icon } from '@lobehub/ui';
import {
Alert,
Button,
createModal,
+ Flexbox,
+ Icon,
Input,
type ModalInstance,
Text,
diff --git a/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx b/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx
index 4b4e0154232..ff316708b71 100644
--- a/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx
+++ b/src/features/SkillStore/SkillList/ImportFromUrlModal.tsx
@@ -1,10 +1,11 @@
'use client';
-import { Flexbox, Icon } from '@lobehub/ui';
import {
Alert,
Button,
createModal,
+ Flexbox,
+ Icon,
Input,
type ModalInstance,
Text,
diff --git a/src/features/SkillStore/SkillList/UploadSkillModal.tsx b/src/features/SkillStore/SkillList/UploadSkillModal.tsx
index cc468cea9cc..51ce30a902b 100644
--- a/src/features/SkillStore/SkillList/UploadSkillModal.tsx
+++ b/src/features/SkillStore/SkillList/UploadSkillModal.tsx
@@ -1,9 +1,10 @@
'use client';
-import { Flexbox, Icon } from '@lobehub/ui';
import {
Alert,
createModal,
+ Flexbox,
+ Icon,
type ModalInstance,
Spin,
Text,
diff --git a/src/features/SkillStore/SkillStoreContent.tsx b/src/features/SkillStore/SkillStoreContent.tsx
index d200396193c..a4787092eb7 100644
--- a/src/features/SkillStore/SkillStoreContent.tsx
+++ b/src/features/SkillStore/SkillStoreContent.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
-import { Tabs, type TabsItem } from '@lobehub/ui';
+import { Flexbox, Tabs, type TabsItem } from '@lobehub/ui';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/SkillsList/RenameSkillModal.tsx b/src/features/SkillsList/RenameSkillModal.tsx
index d24af4ca31a..85a7dcb6f5c 100644
--- a/src/features/SkillsList/RenameSkillModal.tsx
+++ b/src/features/SkillsList/RenameSkillModal.tsx
@@ -1,7 +1,15 @@
'use client';
-import { cssVar, Flexbox } from '@lobehub/ui';
-import { Button, createModal, Input, type ModalInstance, Text, useModalContext } from '@lobehub/ui';
+import {
+ Button,
+ createModal,
+ cssVar,
+ Flexbox,
+ Input,
+ type ModalInstance,
+ Text,
+ useModalContext,
+} from '@lobehub/ui';
import { t } from 'i18next';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/features/SkillsList/SkillsList.tsx b/src/features/SkillsList/SkillsList.tsx
index aa968605e0b..2d2e4f47869 100644
--- a/src/features/SkillsList/SkillsList.tsx
+++ b/src/features/SkillsList/SkillsList.tsx
@@ -1,7 +1,15 @@
import { EMPTY_ARRAY } from '@lobechat/const';
import type { SFSymbol } from '@lobechat/electron-client-ipc';
-import { ContextMenuTrigger, type DropdownItem, Flexbox, Icon, Tooltip } from '@lobehub/ui';
-import { createStaticStyles, cx, Text } from '@lobehub/ui';
+import {
+ ContextMenuTrigger,
+ createStaticStyles,
+ cx,
+ type DropdownItem,
+ Flexbox,
+ Icon,
+ Text,
+ Tooltip,
+} from '@lobehub/ui';
import { SkillsIcon } from '@lobehub/ui/icons';
import { ChevronRightIcon, FileIcon, FolderIcon, type LucideIcon } from 'lucide-react';
import type React from 'react';
diff --git a/src/features/User/UserInfo.tsx b/src/features/User/UserInfo.tsx
index 630217d5e3a..6301d07c816 100644
--- a/src/features/User/UserInfo.tsx
+++ b/src/features/User/UserInfo.tsx
@@ -8,8 +8,8 @@ import ThemeButton from '@/features/User/UserPanel/ThemeButton';
import { useUserStore } from '@/store/user';
import { authSelectors, userProfileSelectors } from '@/store/user/selectors';
-import { type UserAvatarProps } from './UserAvatar';
import UserAvatar from './UserAvatar';
+import { type UserAvatarProps } from './UserAvatar';
export interface UserInfoProps extends FlexboxProps {
avatarProps?: Partial<UserAvatarProps>;
diff --git a/src/features/WorkspaceDeleteAllModal/index.tsx b/src/features/WorkspaceDeleteAllModal/index.tsx
index 0fecccb3d50..0a7a8843455 100644
--- a/src/features/WorkspaceDeleteAllModal/index.tsx
+++ b/src/features/WorkspaceDeleteAllModal/index.tsx
@@ -1,10 +1,10 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
import {
Button,
Checkbox,
createModal,
+ Flexbox,
type ModalInstance,
Text,
useModalContext,
diff --git a/src/features/WorkspaceSetting/Container/index.tsx b/src/features/WorkspaceSetting/Container/index.tsx
index c46e6657ec2..ec4aab9f940 100644
--- a/src/features/WorkspaceSetting/Container/index.tsx
+++ b/src/features/WorkspaceSetting/Container/index.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Flexbox, type FlexboxProps } from '@lobehub/ui';
-import { cssVar } from '@lobehub/ui';
+import { cssVar, Flexbox, type FlexboxProps } from '@lobehub/ui';
import { memo, type PropsWithChildren, type ReactNode } from 'react';
interface WorkspaceSettingsContainerProps extends FlexboxProps {
diff --git a/src/helpers/toolEngineering/index.ts b/src/helpers/toolEngineering/index.ts
index aa940a26595..b40e0ce3bbc 100644
--- a/src/helpers/toolEngineering/index.ts
+++ b/src/helpers/toolEngineering/index.ts
@@ -7,8 +7,8 @@ import {
createEnableChecker,
type LobeToolManifest,
type PluginEnableChecker,
+ ToolsEngine,
} from '@lobechat/context-engine';
-import { ToolsEngine } from '@lobechat/context-engine';
import { assembleManifestPool, resolveToolRules } from '@lobechat/mecha';
import {
type BuiltinToolResolveContext,
diff --git a/src/hooks/useHotkeys/chatScope.test.ts b/src/hooks/useHotkeys/chatScope.test.ts
index 4d0ac5f3574..4916e16d74d 100644
--- a/src/hooks/useHotkeys/chatScope.test.ts
+++ b/src/hooks/useHotkeys/chatScope.test.ts
@@ -1,10 +1,13 @@
-import { HotkeyEnum, HotkeyGroupEnum, HotkeyScopeEnum } from '@lobechat/const/hotkeys';
+import {
+ HotkeyEnum,
+ HotkeyGroupEnum,
+ HOTKEYS_REGISTRATION,
+ HotkeyScopeEnum,
+} from '@lobechat/const/hotkeys';
import type { HotkeyId } from '@lobechat/types';
import { act, renderHook } from '@testing-library/react';
import { beforeEach, describe, expect, it, vi } from 'vitest';
-import { HOTKEYS_REGISTRATION } from '@/const/hotkeys';
-
import { useFindInTopicHotkey, useToggleTerminalPanelHotkey } from './chatScope';
const mocks = vi.hoisted(() => ({
diff --git a/src/hooks/useHotkeys/useHotkeyById.test.ts b/src/hooks/useHotkeys/useHotkeyById.test.ts
index 6a78e4941d8..f581c46ee3d 100644
--- a/src/hooks/useHotkeys/useHotkeyById.test.ts
+++ b/src/hooks/useHotkeys/useHotkeyById.test.ts
@@ -1,10 +1,8 @@
-import { HotkeyEnum, HotkeyScopeEnum } from '@lobechat/const/hotkeys';
+import { HotkeyEnum, HOTKEYS_REGISTRATION, HotkeyScopeEnum } from '@lobechat/const/hotkeys';
import { renderHook } from '@testing-library/react';
import { uniq } from 'es-toolkit/compat';
import { beforeEach, describe, expect, it, vi } from 'vitest';
-import { HOTKEYS_REGISTRATION } from '@/const/hotkeys';
-
import { useHotkeyById } from './useHotkeyById';
// Mock dependencies
diff --git a/src/hooks/useQueryRoute.ts b/src/hooks/useQueryRoute.ts
index 13352c340b0..85d435ea3b2 100644
--- a/src/hooks/useQueryRoute.ts
+++ b/src/hooks/useQueryRoute.ts
@@ -1,6 +1,6 @@
import { isOnServerSide } from '@lobechat/utils';
-import { type ParsedQuery } from 'query-string';
import qs from 'query-string';
+import { type ParsedQuery } from 'query-string';
import { useMemo } from 'react';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
diff --git a/src/libs/providerIcon.ts b/src/libs/providerIcon.ts
index be6c09db668..be0880353bb 100644
--- a/src/libs/providerIcon.ts
+++ b/src/libs/providerIcon.ts
@@ -1,4 +1,4 @@
-/* eslint-disable no-restricted-imports -- the lazy wrapper in @/components/LobeIcons is the only importer */
+/* eslint-disable eslint-core/no-restricted-imports -- the lazy wrapper in @/components/LobeIcons is the only importer */
import {
ProviderCombine as LobeProviderCombine,
ProviderIcon as LobeProviderIcon,
diff --git a/src/libs/swr/index.ts b/src/libs/swr/index.ts
index 28aa54299a4..b64158ee010 100644
--- a/src/libs/swr/index.ts
+++ b/src/libs/swr/index.ts
@@ -1,5 +1,5 @@
-import { type SWRHook } from 'swr';
import useSWR from 'swr';
+import { type SWRHook } from 'swr';
import { useActiveWorkspaceId } from '@/business/client/hooks/useActiveWorkspaceId';
diff --git a/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx b/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx
index b10c54eb9fa..9d2f7846b9d 100644
--- a/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx
+++ b/src/routes/(main)/(create)/features/GenerationInput/GenerationMediaModeSegment.tsx
@@ -1,7 +1,14 @@
'use client';
-import { createStaticStyles, Flexbox, Icon } from '@lobehub/ui';
-import { Segmented, type SegmentedOptions, Select, type SelectProps } from '@lobehub/ui';
+import {
+ createStaticStyles,
+ Flexbox,
+ Icon,
+ Segmented,
+ type SegmentedOptions,
+ Select,
+ type SelectProps,
+} from '@lobehub/ui';
import { ImageIcon, Video } from 'lucide-react';
import { memo, useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/(create)/features/GenerationLayout/Body/List/Item/GridItem.tsx b/src/routes/(main)/(create)/features/GenerationLayout/Body/List/Item/GridItem.tsx
index 5290dfb0fbc..cef494d5596 100644
--- a/src/routes/(main)/(create)/features/GenerationLayout/Body/List/Item/GridItem.tsx
+++ b/src/routes/(main)/(create)/features/GenerationLayout/Body/List/Item/GridItem.tsx
@@ -1,7 +1,14 @@
'use client';
-import { ContextMenuTrigger, type DropdownItem, Flexbox, Tooltip } from '@lobehub/ui';
-import { Avatar, createStaticStyles, cx } from '@lobehub/ui';
+import {
+ Avatar,
+ ContextMenuTrigger,
+ createStaticStyles,
+ cx,
+ type DropdownItem,
+ Flexbox,
+ Tooltip,
+} from '@lobehub/ui';
import type { CSSProperties, MouseEvent } from 'react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageNum.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageNum.tsx
index b4df5625293..59af0a6ceb0 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageNum.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageNum.tsx
@@ -1,7 +1,6 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
-import { ActionIcon, InputNumber, Tabs, type TabsItem } from '@lobehub/ui';
+import { ActionIcon, Flexbox, InputNumber, Tabs, type TabsItem } from '@lobehub/ui';
import { Check, Plus, X } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
diff --git a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx b/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx
index cf8ff3dd87e..4eb4909c824 100644
--- a/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx
+++ b/src/routes/(main)/(create)/image/features/ConfigPanel/components/ImageUpload.tsx
@@ -2,8 +2,8 @@
import { Center, createStaticStyles, cssVar, cx, toast } from '@lobehub/ui';
import { Image as ImageIcon, X } from 'lucide-react';
-import { type FC } from 'react';
import React, { memo, useEffect, useRef, useState } from 'react';
+import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
import Image from '@/libs/next/Image';
diff --git a/src/routes/(main)/agent/channel/Header.tsx b/src/routes/(main)/agent/channel/Header.tsx
index 617bc46fe24..f4bcf2ff403 100644
--- a/src/routes/(main)/agent/channel/Header.tsx
+++ b/src/routes/(main)/agent/channel/Header.tsx
@@ -313,7 +313,11 @@ const Header = memo<HeaderProps>(
agentId={agentId}
extraItems={
view.detail
- ? [view.platformName ?? <SkeletonBar height={14} width={56} />]
+ ? [
+ view.platformName ?? (
+ <SkeletonBar height={14} key="platform-name" width={56} />
+ ),
+ ]
: undefined
}
title={
diff --git a/src/routes/(main)/agent/features/Portal/features/Portal.tsx b/src/routes/(main)/agent/features/Portal/features/Portal.tsx
index bfa63779f09..57b1117fd0d 100644
--- a/src/routes/(main)/agent/features/Portal/features/Portal.tsx
+++ b/src/routes/(main)/agent/features/Portal/features/Portal.tsx
@@ -1,7 +1,11 @@
'use client';
-import { DraggablePanel, type DraggablePanelProps } from '@lobehub/ui';
-import { createStaticStyles, useResponsive } from '@lobehub/ui';
+import {
+ createStaticStyles,
+ DraggablePanel,
+ type DraggablePanelProps,
+ useResponsive,
+} from '@lobehub/ui';
import { type PropsWithChildren } from 'react';
import { Activity, memo, useState } from 'react';
diff --git a/src/routes/(main)/agent/profile/features/Header/index.tsx b/src/routes/(main)/agent/profile/features/Header/index.tsx
index f36a6be57f2..2b8929a7b74 100644
--- a/src/routes/(main)/agent/profile/features/Header/index.tsx
+++ b/src/routes/(main)/agent/profile/features/Header/index.tsx
@@ -1,7 +1,15 @@
import { isDesktop } from '@lobechat/const';
import { getActivePluginIds, type LobeAgentConfig } from '@lobechat/types';
-import { cssVar, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { ActionIcon, confirmModal, type ModalInstance, toast } from '@lobehub/ui';
+import {
+ ActionIcon,
+ confirmModal,
+ cssVar,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ type ModalInstance,
+ toast,
+} from '@lobehub/ui';
import isEqual from 'fast-deep-equal';
import type { TFunction } from 'i18next';
import {
diff --git a/src/routes/(main)/community/_layout/Sidebar/Header/Nav.tsx b/src/routes/(main)/community/_layout/Sidebar/Header/Nav.tsx
index 892459a44a1..c17c1f589d7 100644
--- a/src/routes/(main)/community/_layout/Sidebar/Header/Nav.tsx
+++ b/src/routes/(main)/community/_layout/Sidebar/Header/Nav.tsx
@@ -6,8 +6,8 @@ import { Bot, Brain, ShapesIcon } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
-import { type NavItemProps } from '@/features/NavPanel/components/NavItem';
import NavItem from '@/features/NavPanel/components/NavItem';
+import { type NavItemProps } from '@/features/NavPanel/components/NavItem';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import WorkspaceLink from '@/features/Workspace/WorkspaceLink';
import { useActiveLocation } from '@/hooks/useActiveLocation';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/_layout/Sidebar/Header/BenchmarkHead.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/_layout/Sidebar/Header/BenchmarkHead.tsx
index ac7b35d9ba9..8a6cb6f5f75 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/_layout/Sidebar/Header/BenchmarkHead.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/_layout/Sidebar/Header/BenchmarkHead.tsx
@@ -96,7 +96,7 @@ const BenchmarkHead = memo<{ id: string }>(({ id }) => {
onClick: () => handleBenchmarkSwitch(b.id),
style: b.id === id ? { backgroundColor: cssVar.controlItemBgActive } : {},
}));
- }, [benchmarkList, handleBenchmarkSwitch, id, styles.menuIcon]);
+ }, [benchmarkList, handleBenchmarkSwitch, id]);
return (
<Block
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx
index 3576c03a918..eadc1959d39 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/BenchmarkHeader/index.tsx
@@ -2,8 +2,17 @@
import type { AgentEvalRunListItem } from '@lobechat/types';
import { formatCost } from '@lobechat/utils';
-import { type DropdownItem, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { Button, confirmModal, createStaticStyles, cssVar, Text } from '@lobehub/ui';
+import {
+ Button,
+ confirmModal,
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ Text,
+} from '@lobehub/ui';
import {
CircleDollarSign,
Clock,
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
index 4b30c690e61..dbe1a8867fb 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/DatasetsTab/TestCaseTable.tsx
@@ -1,5 +1,16 @@
-import { createStaticStyles, cssVar, DropdownMenu, Flexbox } from '@lobehub/ui';
-import { ActionIcon, Button, Input, Pagination, Table, type TableColumn, Text } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Button,
+ createStaticStyles,
+ cssVar,
+ DropdownMenu,
+ Flexbox,
+ Input,
+ Pagination,
+ Table,
+ type TableColumn,
+ Text,
+} from '@lobehub/ui';
import { Ellipsis, ExternalLink, FileUp, Pencil, Plus, Search, Trash2 } from 'lucide-react';
import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Footer.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Footer.tsx
index 98723c60a65..853693b1014 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Footer.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunCreateModal/Footer.tsx
@@ -1,7 +1,14 @@
'use client';
-import { type DropdownItem, DropdownMenu, Flexbox } from '@lobehub/ui';
-import { Button, createStaticStyles, ModalFooter, useModalContext } from '@lobehub/ui';
+import {
+ Button,
+ createStaticStyles,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ ModalFooter,
+ useModalContext,
+} from '@lobehub/ui';
import { ChevronDown } from 'lucide-react';
import { type FC } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/RunCard.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/RunCard.tsx
index db1e947f224..21598a46b86 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/RunCard.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/features/RunsTab/RunCard.tsx
@@ -1,6 +1,14 @@
import type { AgentEvalRunListItem } from '@lobechat/types';
-import { type DropdownItem, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
-import { confirmModal, createStaticStyles, cssVar, toast } from '@lobehub/ui';
+import {
+ confirmModal,
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ toast,
+} from '@lobehub/ui';
import {
AlertTriangle,
ArrowRight,
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx
index 608c304f03a..ac63c573077 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/BatchResumeModal/Content.tsx
@@ -1,7 +1,16 @@
'use client';
-import { Badge, Checkbox, Table, type TableColumn, Tag, Text, Tooltip } from '@lobehub/ui';
-import { createStaticStyles, cssVar } from '@lobehub/ui';
+import {
+ Badge,
+ Checkbox,
+ createStaticStyles,
+ cssVar,
+ Table,
+ type TableColumn,
+ Tag,
+ Text,
+ Tooltip,
+} from '@lobehub/ui';
import { type FC, memo, useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx
index 654656f24cf..8bed444687d 100644
--- a/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx
+++ b/src/routes/(main)/eval/bench/[benchmarkId]/runs/[runId]/features/CaseResultsTable/index.tsx
@@ -2,10 +2,13 @@
import type { EvalThreadResult } from '@lobechat/types';
import { formatCost, formatShortenNumber } from '@lobechat/utils';
-import { createStaticStyles, cssVar, Flexbox, Icon } from '@lobehub/ui';
import {
ActionIcon,
Badge,
+ createStaticStyles,
+ cssVar,
+ Flexbox,
+ Icon,
Input,
Select,
Table,
diff --git a/src/routes/(main)/eval/features/Experiments/ExperimentHeader.tsx b/src/routes/(main)/eval/features/Experiments/ExperimentHeader.tsx
index cfb1b8fb96a..15ea7ce75d9 100644
--- a/src/routes/(main)/eval/features/Experiments/ExperimentHeader.tsx
+++ b/src/routes/(main)/eval/features/Experiments/ExperimentHeader.tsx
@@ -1,8 +1,17 @@
'use client';
import type { AgentEvalExperimentDetail } from '@lobechat/types';
-import { createStaticStyles, cssVar, Flexbox } from '@lobehub/ui';
-import { Button, confirmModal, type DropdownItem, DropdownMenu, Text, toast } from '@lobehub/ui';
+import {
+ Button,
+ confirmModal,
+ createStaticStyles,
+ cssVar,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Text,
+ toast,
+} from '@lobehub/ui';
import { Ellipsis, Pencil, Trash2 } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx b/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx
index cb08334b1e8..89300db46a6 100644
--- a/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx
+++ b/src/routes/(main)/group/_layout/Sidebar/Header/Agent/SwitchPanel.tsx
@@ -1,6 +1,6 @@
import { Flexbox, Popover } from '@lobehub/ui';
-import { type PropsWithChildren } from 'react';
import React, { memo, Suspense, useState } from 'react';
+import { type PropsWithChildren } from 'react';
import List from '@/features/HomeSidebar/Body/Agent/List';
import { AgentModalProvider } from '@/features/HomeSidebar/Body/Agent/ModalProvider';
diff --git a/src/routes/(main)/group/_layout/Sidebar/Header/Agent/index.tsx b/src/routes/(main)/group/_layout/Sidebar/Header/Agent/index.tsx
index 8469b8c19d9..3c67b91ff41 100644
--- a/src/routes/(main)/group/_layout/Sidebar/Header/Agent/index.tsx
+++ b/src/routes/(main)/group/_layout/Sidebar/Header/Agent/index.tsx
@@ -2,8 +2,8 @@
import { ActionIcon, Block, Text } from '@lobehub/ui';
import { ChevronsUpDownIcon } from 'lucide-react';
-import { type PropsWithChildren } from 'react';
import React, { memo } from 'react';
+import { type PropsWithChildren } from 'react';
import { useTranslation } from 'react-i18next';
import { SkeletonItem } from '@/features/NavPanel/components/SkeletonList';
diff --git a/src/routes/(main)/group/profile/features/GroupProfile/index.tsx b/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
index 3e8f3092e6e..cf03566b0c3 100644
--- a/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
+++ b/src/routes/(main)/group/profile/features/GroupProfile/index.tsx
@@ -1,7 +1,15 @@
'use client';
-import { DropdownMenu, Flexbox, Icon, useTheme } from '@lobehub/ui';
-import { ActionIcon, Button, Divider, type ModalInstance } from '@lobehub/ui';
+import {
+ ActionIcon,
+ Button,
+ Divider,
+ DropdownMenu,
+ Flexbox,
+ Icon,
+ type ModalInstance,
+ useTheme,
+} from '@lobehub/ui';
import { MoreHorizontalIcon, PlayIcon, Settings2Icon, UsersIcon } from 'lucide-react';
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/group/profile/features/Header/ChromeTabs/index.tsx b/src/routes/(main)/group/profile/features/Header/ChromeTabs/index.tsx
index 72053188e53..c08659c2b99 100644
--- a/src/routes/(main)/group/profile/features/Header/ChromeTabs/index.tsx
+++ b/src/routes/(main)/group/profile/features/Header/ChromeTabs/index.tsx
@@ -1,7 +1,14 @@
'use client';
-import { type DropdownItem, DropdownMenu, Flexbox, Tooltip } from '@lobehub/ui';
-import { Avatar, createStaticStyles, cx } from '@lobehub/ui';
+import {
+ Avatar,
+ createStaticStyles,
+ cx,
+ type DropdownItem,
+ DropdownMenu,
+ Flexbox,
+ Tooltip,
+} from '@lobehub/ui';
import { Plus } from 'lucide-react';
import { type ReactNode } from 'react';
import { memo, useEffect, useRef } from 'react';
diff --git a/src/routes/(main)/group/profile/features/Header/index.tsx b/src/routes/(main)/group/profile/features/Header/index.tsx
index d60a43adce8..5885d1120e2 100644
--- a/src/routes/(main)/group/profile/features/Header/index.tsx
+++ b/src/routes/(main)/group/profile/features/Header/index.tsx
@@ -1,7 +1,6 @@
'use client';
-import { type DropdownItem, Flexbox, Icon } from '@lobehub/ui';
-import { createStaticStyles } from '@lobehub/ui';
+import { createStaticStyles, type DropdownItem, Flexbox, Icon } from '@lobehub/ui';
import { Crown, Sparkles, Users, UsersRound } from 'lucide-react';
import { memo, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
@@ -19,8 +18,8 @@ import { systemStatusSelectors } from '@/store/global/selectors';
import { isMobileSurface } from '@/utils/mobileSurface';
import AgentBuilderToggle from './AgentBuilderToggle';
-import { type ChromeTabItem } from './ChromeTabs';
import ChromeTabs from './ChromeTabs';
+import { type ChromeTabItem } from './ChromeTabs';
const styles = createStaticStyles(({ css, cssVar }) => ({
header: css`
diff --git a/src/routes/(main)/memory/_layout/Sidebar/Header/Nav.tsx b/src/routes/(main)/memory/_layout/Sidebar/Header/Nav.tsx
index 8a311769283..75f7e25ab7e 100644
--- a/src/routes/(main)/memory/_layout/Sidebar/Header/Nav.tsx
+++ b/src/routes/(main)/memory/_layout/Sidebar/Header/Nav.tsx
@@ -14,8 +14,8 @@ import { memo, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { Link } from 'react-router';
-import { type NavItemProps } from '@/features/NavPanel/components/NavItem';
import NavItem from '@/features/NavPanel/components/NavItem';
+import { type NavItemProps } from '@/features/NavPanel/components/NavItem';
import { useSelfLearningSurface } from '@/features/SelfLearning/SurfaceGate/useSelfLearningSurface';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import { useActiveLocation } from '@/hooks/useActiveLocation';
diff --git a/src/routes/(main)/memory/activities/features/ActivityDropdown.tsx b/src/routes/(main)/memory/activities/features/ActivityDropdown.tsx
index c0832480868..f0c65c6a5a2 100644
--- a/src/routes/(main)/memory/activities/features/ActivityDropdown.tsx
+++ b/src/routes/(main)/memory/activities/features/ActivityDropdown.tsx
@@ -1,5 +1,4 @@
-import { DropdownMenu } from '@lobehub/ui';
-import { ActionIcon, type ActionIconProps, confirmModal } from '@lobehub/ui';
+import { ActionIcon, type ActionIconProps, confirmModal, DropdownMenu } from '@lobehub/ui';
import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react';
import { type KeyboardEvent, type MouseEvent } from 'react';
import { memo } from 'react';
diff --git a/src/routes/(main)/memory/activities/index.tsx b/src/routes/(main)/memory/activities/index.tsx
index 04bfaae6108..dd2eff1d5c7 100644
--- a/src/routes/(main)/memory/activities/index.tsx
+++ b/src/routes/(main)/memory/activities/index.tsx
@@ -16,8 +16,8 @@ import { useUserMemoryStore } from '@/store/userMemory';
import EditableModal from '../features/EditableModal';
import FilterBar from '../features/FilterBar';
import Loading from '../features/Loading';
-import { type ViewMode } from '../features/ViewModeSwitcher';
import ViewModeSwitcher from '../features/ViewModeSwitcher';
+import { type ViewMode } from '../features/ViewModeSwitcher';
import ActivityRightPanel from './features/ActivityRightPanel';
import List from './features/List';
diff --git a/src/routes/(main)/memory/features/DetailPanel.tsx b/src/routes/(main)/memory/features/DetailPanel.tsx
index 5b29b01652b..1fd6c325bf7 100644
--- a/src/routes/(main)/memory/features/DetailPanel.tsx
+++ b/src/routes/(main)/memory/features/DetailPanel.tsx
@@ -2,8 +2,8 @@ import { type FlexboxProps } from '@lobehub/ui';
import { Flexbox } from '@lobehub/ui';
import { memo } from 'react';
-import { type NavHeaderProps } from '@/features/NavHeader';
import NavHeader from '@/features/NavHeader';
+import { type NavHeaderProps } from '@/features/NavHeader';
import RightPanel from '@/features/RightPanel';
import ToggleRightPanelButton from '@/features/RightPanel/ToggleRightPanelButton';
diff --git a/src/routes/(main)/memory/features/GridView/index.tsx b/src/routes/(main)/memory/features/GridView/index.tsx
index 331556519f1..9d3605bab6d 100644
--- a/src/routes/(main)/memory/features/GridView/index.tsx
+++ b/src/routes/(main)/memory/features/GridView/index.tsx
@@ -69,7 +69,8 @@ function GridViewInner<T extends { id: string }>({
style={{ minHeight: '100%' }}
components={{
Footer: footer
- ? () => (
+ ? // eslint-disable-next-line @eslint-react/no-nested-component-definitions -- reads the latest pagination state on every render
+ () => (
<LoadMoreFooter
loadMoreError={loadMoreError}
rows={defaultColumnCount}
diff --git a/src/routes/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx b/src/routes/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx
index 68e8ed45ab9..57fcd2198a0 100644
--- a/src/routes/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx
+++ b/src/routes/(main)/memory/features/MemoryAnalysis/DateRangeModal.tsx
@@ -1,11 +1,11 @@
'use client';
-import { Flexbox } from '@lobehub/ui';
import {
Button,
createModal,
DayjsDateRangePicker as DateRangePicker,
type DayjsDateRangeValue,
+ Flexbox,
type ModalInstance,
Text,
toast,
diff --git a/src/routes/(main)/memory/features/TimeLineView/index.tsx b/src/routes/(main)/memory/features/TimeLineView/index.tsx
index 523559b7a00..e74701d9927 100644
--- a/src/routes/(main)/memory/features/TimeLineView/index.tsx
+++ b/src/routes/(main)/memory/features/TimeLineView/index.tsx
@@ -157,7 +157,8 @@ function TimelineViewInner<
style={{ minHeight: '100%' }}
components={{
Footer: footer
- ? () => (
+ ? // eslint-disable-next-line @eslint-react/no-nested-component-definitions -- reads the latest pagination state on every render
+ () => (
<LoadMoreFooter
loadMoreError={loadMoreError}
state={footer}
diff --git a/src/routes/(main)/memory/identities/features/IdentityDropdown.tsx b/src/routes/(main)/memory/identities/features/IdentityDropdown.tsx
index 5bfa49d33c8..c966c1c30e3 100644
--- a/src/routes/(main)/memory/identities/features/IdentityDropdown.tsx
+++ b/src/routes/(main)/memory/identities/features/IdentityDropdown.tsx
@@ -1,5 +1,4 @@
-import { DropdownMenu } from '@lobehub/ui';
-import { ActionIcon, type ActionIconProps, confirmModal } from '@lobehub/ui';
+import { ActionIcon, type ActionIconProps, confirmModal, DropdownMenu } from '@lobehub/ui';
import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react';
import { type KeyboardEvent, type MouseEvent } from 'react';
import { memo } from 'react';
diff --git a/src/routes/(main)/memory/identities/index.tsx b/src/routes/(main)/memory/identities/index.tsx
index df163462824..f9e2ff2bef4 100644
--- a/src/routes/(main)/memory/identities/index.tsx
+++ b/src/routes/(main)/memory/identities/index.tsx
@@ -16,11 +16,11 @@ import { isIdentityQueryCurrent } from '@/store/userMemory/slices/identity/proje
import EditableModal from '../features/EditableModal';
import Loading from '../features/Loading';
import { SCROLL_PARENT_ID } from '../features/TimeLineView/useScrollParent';
-import { type ViewMode } from '../features/ViewModeSwitcher';
import ViewModeSwitcher from '../features/ViewModeSwitcher';
+import { type ViewMode } from '../features/ViewModeSwitcher';
import IdentityRightPanel from './features/IdentityRightPanel';
-import { type IdentityType } from './features/List';
import List from './features/List';
+import { type IdentityType } from './features/List';
import SegmentedBar from './features/SegmentedBar';
import { identityListBoundary } from './identityListBoundary';
import { identityListParamsOf } from './identityListParams';
diff --git a/src/routes/(main)/memory/preferences/features/PreferenceDropdown.tsx b/src/routes/(main)/memory/preferences/features/PreferenceDropdown.tsx
index 028ce3c9e6b..a954e15b5fc 100644
--- a/src/routes/(main)/memory/preferences/features/PreferenceDropdown.tsx
+++ b/src/routes/(main)/memory/preferences/features/PreferenceDropdown.tsx
@@ -1,5 +1,4 @@
-import { DropdownMenu } from '@lobehub/ui';
-import { ActionIcon, type ActionIconProps, confirmModal } from '@lobehub/ui';
+import { ActionIcon, type ActionIconProps, confirmModal, DropdownMenu } from '@lobehub/ui';
import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react';
import { type KeyboardEvent, type MouseEvent } from 'react';
import { memo } from 'react';
diff --git a/src/routes/(main)/memory/preferences/index.tsx b/src/routes/(main)/memory/preferences/index.tsx
index 2d97aebf0a6..721366b8c24 100644
--- a/src/routes/(main)/memory/preferences/index.tsx
+++ b/src/routes/(main)/memory/preferences/index.tsx
@@ -16,8 +16,8 @@ import { useUserMemoryStore } from '@/store/userMemory';
import EditableModal from '../features/EditableModal';
import FilterBar from '../features/FilterBar';
import Loading from '../features/Loading';
-import { type ViewMode } from '../features/ViewModeSwitcher';
import ViewModeSwitcher from '../features/ViewModeSwitcher';
+import { type ViewMode } from '../features/ViewModeSwitcher';
import List from './features/List';
import PreferenceRightPanel from './features/PreferenceRightPanel';
diff --git a/src/routes/(mobile)/me/(home)/features/useCategory.tsx b/src/routes/(mobile)/me/(home)/features/useCategory.tsx
index 04288f3d612..d2e413a36ea 100644
--- a/src/routes/(mobile)/me/(home)/features/useCategory.tsx
+++ b/src/routes/(mobile)/me/(home)/features/useCategory.tsx
@@ -1,5 +1,5 @@
import { LOBE_CHAT_CLOUD, UTM_SOURCE } from '@lobechat/business-const';
-import { DOWNLOAD_URL, OFFICIAL_URL } from '@lobechat/const';
+import { DOCUMENTS, DOWNLOAD_URL, FEEDBACK, OFFICIAL_URL } from '@lobechat/const';
import {
Book,
CircleUserRound,
@@ -16,7 +16,6 @@ import { useNavigate } from 'react-router';
import useBusinessMeCells from '@/business/client/features/User/useBusinessMeCells';
import { type CellProps } from '@/components/Cell';
import { openChangelogModal } from '@/components/ChangelogModal';
-import { DOCUMENTS, FEEDBACK } from '@/const/index';
import { usePlatform } from '@/hooks/usePlatform';
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
import { useUserStore } from '@/store/user';
diff --git a/src/routes/(mobile)/me/profile/features/Category.tsx b/src/routes/(mobile)/me/profile/features/Category.tsx
index 05816b91912..05e2e875ec8 100644
--- a/src/routes/(mobile)/me/profile/features/Category.tsx
+++ b/src/routes/(mobile)/me/profile/features/Category.tsx
@@ -4,8 +4,8 @@ import { ChartColumnBigIcon, LogOut, UserCircle } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
-import { type CellProps } from '@/components/Cell';
import Cell from '@/components/Cell';
+import { type CellProps } from '@/components/Cell';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
import { ProfileTabs } from '@/store/global/initialState';
import { useUserStore } from '@/store/user';
diff --git a/src/services/message/replica.ts b/src/services/message/replica.ts
index 71971cda5f2..3e9e17c1c83 100644
--- a/src/services/message/replica.ts
+++ b/src/services/message/replica.ts
@@ -1,7 +1,7 @@
import type { ConversationContext, UIChatMessage } from '@lobechat/types';
-import { AppIndexedDBStorage } from '@/libs/replica';
import {
+ AppIndexedDBStorage,
cacheScope,
defineReplica,
isReplicaSyncKey,
diff --git a/src/store/agent/selectors/selectors.ts b/src/store/agent/selectors/selectors.ts
index cb4ff4845e0..22226495863 100644
--- a/src/store/agent/selectors/selectors.ts
+++ b/src/store/agent/selectors/selectors.ts
@@ -12,18 +12,16 @@ import {
agentDisplayName,
type AgentMode,
type AgentProfile,
+ getActivePluginIds,
+ getDisabledPluginIds,
+ getWorkingDirEffectivePath,
type KnowledgeItem,
+ KnowledgeType,
type LobeAgentConfig,
type LobeAgentTTSConfig,
type MetaData,
type RuntimeEnvConfig,
} from '@lobechat/types';
-import {
- getActivePluginIds,
- getDisabledPluginIds,
- getWorkingDirEffectivePath,
- KnowledgeType,
-} from '@lobechat/types';
import { DEFAULT_OPENING_QUESTIONS } from '@/features/AgentSetting/store/selectors';
import { resolveTargetDeviceId } from '@/helpers/agentWorkingDirectory';
diff --git a/src/store/chat/slices/topic/action.ts b/src/store/chat/slices/topic/action.ts
index 155c6d6fae7..7308d68a5ba 100644
--- a/src/store/chat/slices/topic/action.ts
+++ b/src/store/chat/slices/topic/action.ts
@@ -19,8 +19,8 @@ import { toast } from '@lobehub/ui';
import isEqual from 'fast-deep-equal';
import { t } from 'i18next';
import type { AiModelReasoningConfig } from 'model-bank';
-import { type SWRResponse } from 'swr';
import useSWR from 'swr';
+import { type SWRResponse } from 'swr';
import { LOADING_FLAT } from '@/const/message';
import {
diff --git a/src/store/device/projection.ts b/src/store/device/projection.ts
index 6bd4851615b..a883c7bdd2a 100644
--- a/src/store/device/projection.ts
+++ b/src/store/device/projection.ts
@@ -1,7 +1,11 @@
import type { DeviceListItem, DeviceMetricSeries, DeviceScope } from '@lobechat/types';
-import { AppLocalStorage } from '@/libs/replica';
-import { defineReplica, REPLICA_INDEX_KEY, type ReplicaStorage } from '@/libs/replica';
+import {
+ AppLocalStorage,
+ defineReplica,
+ REPLICA_INDEX_KEY,
+ type ReplicaStorage,
+} from '@/libs/replica';
/** The store reads every device of the active scope, so the list has one entry. */
export const DEVICE_LIST_KEY = 'all';
diff --git a/src/store/document/store.ts b/src/store/document/store.ts
index dccd9acc1df..a46f22e20fb 100644
--- a/src/store/document/store.ts
+++ b/src/store/document/store.ts
@@ -7,11 +7,11 @@ import { expose } from '../middleware/expose';
import { flattenActions } from '../utils/flattenActions';
import { type ResetableStore, ResetableStoreAction } from '../utils/resetableStore';
import {
+ createDocumentSlice,
type DocumentAction,
type DocumentDetailSliceState,
initialDocumentDetailSliceState,
} from './slices/document';
-import { createDocumentSlice } from './slices/document';
import { type EditorAction, type EditorState } from './slices/editor';
import { createEditorSlice, initialEditorState } from './slices/editor';
diff --git a/src/store/electron/actions/gateway.ts b/src/store/electron/actions/gateway.ts
index 4d24162531b..a56c380b04d 100644
--- a/src/store/electron/actions/gateway.ts
+++ b/src/store/electron/actions/gateway.ts
@@ -1,7 +1,7 @@
import { isDesktop } from '@lobechat/const';
import type { GatewayConnectionState } from '@lobechat/electron-client-ipc';
-import { type SWRResponse } from 'swr';
import useSWR from 'swr';
+import { type SWRResponse } from 'swr';
import { createReplicaSlice, recordLens, type ReplicaSyncResult } from '@/libs/replica';
import { electronKeys } from '@/libs/swr/keys';
diff --git a/src/store/electron/actions/settings.ts b/src/store/electron/actions/settings.ts
index 0d2492b4a4e..6f5a8e35cd9 100644
--- a/src/store/electron/actions/settings.ts
+++ b/src/store/electron/actions/settings.ts
@@ -4,8 +4,8 @@ import {
type ShortcutUpdateResult,
} from '@lobechat/electron-client-ipc';
import isEqual from 'fast-deep-equal';
-import { type SWRResponse } from 'swr';
import useSWR from 'swr';
+import { type SWRResponse } from 'swr';
import { mutate } from '@/libs/swr';
import { electronKeys } from '@/libs/swr/keys';
diff --git a/src/store/electron/actions/sync.ts b/src/store/electron/actions/sync.ts
index 25944ecfe92..efc3d949e3f 100644
--- a/src/store/electron/actions/sync.ts
+++ b/src/store/electron/actions/sync.ts
@@ -1,8 +1,8 @@
import { isDesktop } from '@lobechat/const';
import { type DataSyncConfig } from '@lobechat/electron-client-ipc';
import isEqual from 'fast-deep-equal';
-import { type SWRResponse } from 'swr';
import useSWR from 'swr';
+import { type SWRResponse } from 'swr';
import { mutate } from '@/libs/swr';
import { electronKeys } from '@/libs/swr/keys';
diff --git a/src/store/user/slices/common/action.ts b/src/store/user/slices/common/action.ts
index 438f3294bda..5dc9552ef3c 100644
--- a/src/store/user/slices/common/action.ts
+++ b/src/store/user/slices/common/action.ts
@@ -2,8 +2,8 @@ import { isDesktop } from '@lobechat/const';
import type { UserGeneralConfig } from '@lobechat/types';
import isEqual from 'fast-deep-equal';
import type { ReplicaSlice } from 'local-replica/zustand';
-import { type SWRResponse } from 'swr';
import useSWR from 'swr';
+import { type SWRResponse } from 'swr';
import { type PartialDeep } from 'type-fest';
import { DEFAULT_PREFERENCE } from '@/const/user';
diff --git a/src/styles/global.css b/src/styles/global.css
index 0717d3694ee..35533383aba 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -113,9 +113,11 @@ button {
html:has(> body > .conversation-print-root),
body:has(> .conversation-print-root) {
overflow: visible;
+
height: auto;
min-height: 0;
max-height: none;
+
color-scheme: light !important;
background: none !important;
}
diff --git a/stylelint.config.mjs b/stylelint.config.mjs
index 356d2cc0e9e..120fec3ada3 100644
--- a/stylelint.config.mjs
+++ b/stylelint.config.mjs
@@ -1,4 +1,4 @@
-import { stylelint } from '@lobehub/lint';
+import stylelint from '@lobehub/stylelint-config';
export default {
...stylelint,
@@ -12,6 +12,10 @@ export default {
'Do not set text-transform: uppercase; write the label in the case it should read.',
},
],
+ // Custom properties mirror the camelCase antd token names (--colorText).
+ 'custom-property-pattern': null,
+ // CSS modules scope selectors with :global / :local.
+ 'selector-pseudo-class-no-unknown': [true, { ignorePseudoClasses: ['global', 'local'] }],
// Temporarily disabled for gradual migration
'declaration-property-value-keyword-no-deprecated': null,
'declaration-property-value-no-unknown': null,