chore: 迁移 lint/format 工具链 ESLint+Prettier → oxlint+oxfmt

This commit is contained in:
2026-06-06 00:57:55 +08:00
parent 3f88e33bd1
commit 121c6f764f
45 changed files with 625 additions and 1004 deletions

1
.gitignore vendored
View File

@@ -400,7 +400,6 @@ cython_debug/
# Custom
.opencode
.codex
openspec/changes/archive
temp
.agents

View File

@@ -1,4 +1,4 @@
{
"*.{ts,tsx}": ["eslint --fix"],
"*.{md,json,yaml,yml}": ["prettier --write"]
"*.{ts,tsx,js,jsx}": ["oxlint --fix", "oxfmt"],
"*.{md,json,yaml,yml}": ["oxfmt"]
}

18
.oxfmtrc.json Normal file
View File

@@ -0,0 +1,18 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 120,
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"tabWidth": 2,
"useTabs": false,
"sortPackageJson": false,
"sortImports": {
"partitionByNewline": true,
"newlinesBetween": false
},
"ignorePatterns": ["openspec/**", "bun.lock", "bin/**", "eslint-rules/**", "skills-lock.json"]
}

274
.oxlintrc.json Normal file
View File

@@ -0,0 +1,274 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "import", "unicorn"],
"jsPlugins": ["./eslint-rules/local-rules.js"],
"categories": {
"correctness": "off"
},
"options": {
"typeAware": true
},
"env": {
"builtin": true,
"es2018": true
},
"ignorePatterns": ["openspec/**", "bun.lock", "bin/**", "eslint-rules/**", "skills-lock.json"],
"rules": {
"constructor-super": "error",
"for-direction": "error",
"getter-return": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-const-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-class-members": "error",
"no-dupe-else-if": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-import-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-new-native-nonconstructor": "error",
"no-nonoctal-decimal-escape": "error",
"no-obj-calls": "error",
"no-prototype-builtins": "error",
"no-redeclare": "error",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-setter-return": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-this-before-super": "error",
"no-unassigned-vars": "error",
"no-unreachable": "error",
"no-unsafe-finally": "error",
"no-unsafe-negation": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"no-with": "error",
"preserve-caught-error": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-array-constructor": "error",
"no-unused-expressions": "error",
"import/namespace": "error",
"import/default": "error",
"import/no-named-as-default": "warn",
"import/no-named-as-default-member": "warn",
"import/no-duplicates": "warn",
"typescript/await-thenable": "error",
"typescript/ban-ts-comment": "error",
"typescript/no-array-delete": "error",
"typescript/no-base-to-string": "error",
"typescript/no-duplicate-enum-values": "error",
"typescript/no-duplicate-type-constituents": "error",
"typescript/no-empty-object-type": "error",
"typescript/no-explicit-any": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-floating-promises": "error",
"typescript/no-for-in-array": "error",
"typescript/no-implied-eval": "error",
"typescript/no-misused-new": "error",
"typescript/no-misused-promises": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-redundant-type-constituents": "error",
"typescript/no-require-imports": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-assertion": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-argument": "error",
"typescript/no-unsafe-assignment": "error",
"typescript/no-unsafe-call": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-enum-comparison": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-unsafe-member-access": "error",
"typescript/no-unsafe-return": "error",
"typescript/no-unsafe-unary-minus": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/only-throw-error": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/prefer-promise-reject-errors": "error",
"typescript/require-await": "error",
"typescript/restrict-plus-operands": "error",
"typescript/restrict-template-expressions": "error",
"typescript/triple-slash-reference": "error",
"typescript/unbound-method": "error",
"typescript/adjacent-overload-signatures": "error",
"typescript/array-type": [
"error",
{
"default": "array-simple"
}
],
"typescript/ban-tslint-comment": "error",
"typescript/class-literal-property-style": "error",
"typescript/consistent-generic-constructors": "error",
"typescript/consistent-indexed-object-style": "error",
"typescript/consistent-type-assertions": [
"error",
{
"assertionStyle": "as"
}
],
"typescript/consistent-type-definitions": "error",
"typescript/dot-notation": "error",
"typescript/no-confusing-non-null-assertion": "error",
"typescript/no-inferrable-types": "error",
"typescript/non-nullable-type-assertion-style": "error",
"typescript/prefer-find": "error",
"typescript/prefer-for-of": "error",
"typescript/prefer-function-type": "error",
"typescript/prefer-includes": "error",
"typescript/prefer-nullish-coalescing": "error",
"typescript/prefer-regexp-exec": "error",
"typescript/prefer-string-starts-ends-with": "error",
"typescript/consistent-type-imports": [
"error",
{
"prefer": "type-imports"
}
]
},
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
"rules": {
"constructor-super": "off",
"getter-return": "off",
"no-class-assign": "off",
"no-const-assign": "off",
"no-dupe-class-members": "off",
"no-dupe-keys": "off",
"no-func-assign": "off",
"no-import-assign": "off",
"no-new-native-nonconstructor": "off",
"no-obj-calls": "off",
"no-redeclare": "off",
"no-setter-return": "off",
"no-this-before-super": "off",
"no-unreachable": "off",
"no-unsafe-negation": "off",
"no-var": "error",
"no-with": "off",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error"
}
},
{
"files": ["src/**/*.{ts,tsx}"],
"rules": {
"local-rules/enforce-catch-type": "warn",
"local-rules/no-empty-function": "error"
}
},
{
"files": ["src/server/db/**/*.ts"],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"importNames": ["sqliteTable"],
"message": "请从 ./helpers.ts 导入 sqliteTable并在列定义中展开 baseColumns。参见 src/server/db/helpers.ts。",
"name": "drizzle-orm/sqlite-core"
}
]
}
]
}
},
{
"files": ["src/server/db/helpers.ts"],
"rules": {
"no-restricted-imports": "off"
}
},
{
"files": ["src/server/**/*.ts"],
"rules": {
"no-console": "error"
}
},
{
"files": ["src/server/logger.ts"],
"rules": {
"no-console": "off"
}
},
{
"files": ["src/web/**/*.{ts,tsx}"],
"rules": {
"no-console": "error",
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": [
"../server/*",
"../server/**",
"../**/server/*",
"../**/server/**",
"../../server/*",
"../../server/**",
"src/server/*",
"src/server/**"
],
"message": "前端不得导入 src/server 后端运行时实现;请改用 src/shared 类型或 HTTP API。"
}
]
}
],
"react/rules-of-hooks": "error",
"react/exhaustive-deps": "warn",
"react/only-export-components": [
"warn",
{
"allowConstantExport": true
}
]
},
"plugins": ["react"]
},
{
"files": ["src/web/**/logger.ts"],
"rules": {
"no-console": "off"
}
}
]
}

View File

@@ -1,13 +0,0 @@
node_modules/
dist/
.build/
*.bun-build
openspec/
bun.lock
.opencode/
.claude/
.codex/
.agents/
skills-lock.json
data/
probe-config.schema.json

View File

@@ -1,11 +0,0 @@
{
"printWidth": 120,
"semi": true,
"singleQuote": false,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always",
"endOfLine": "lf",
"tabWidth": 2,
"useTabs": false
}

View File

@@ -6,5 +6,11 @@
"files.eol": "\n",
"files.encoding": "utf8",
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
"files.trimTrailingWhitespace": true,
"[javascript][typescript][javascriptreact][typescriptreact]": {
"editor.defaultFormatter": "oxc.oxc"
},
"eslint.enable": false
}

1010
bun.lock

File diff suppressed because it is too large Load Diff

View File

@@ -219,7 +219,7 @@ features/<name>/
- 列名 snake_caseTS 类型 camelCaseDrizzle schema 映射。
- 软删除:所有业务表使用 `deleted_at` 列,通过 `notDeleted(table)``paginateQuery({ softDelete })` 过滤。`deleted_at` 不暴露到 API 层。
- 唯一性:无数据库级 UNIQUE 约束DAO 层应用校验(同字段 + `deleted_at IS NULL`)。
- 表定义:通过 `helpers.ts``baseColumns` 展开 id/created_at/updated_at/deleted_at禁止直接 `sqliteTable()`ESLint 强制)。
- 表定义:通过 `helpers.ts``baseColumns` 展开 id/created_at/updated_at/deleted_at禁止直接 `sqliteTable()`oxlint 强制)。
### AI 调用层
@@ -313,8 +313,8 @@ features/<name>/
| `bun run schema` | 生成 config.schema.json |
| `bun run schema:check` | 检查 schema 同步 |
| `bun run typecheck` | TypeScript 类型检查 |
| `bun run lint` | ESLint + Prettier 检查 |
| `bun run format` | Prettier 格式化 |
| `bun run lint` | oxlint 检查(--deny-warnings |
| `bun run format` | oxfmt 格式化 |
| `bun test` | 运行全部测试 |
| `bun run clean` | 清理构建缓存 |
| `bun run version:patch` | 升迁 patch 版本 |

View File

@@ -0,0 +1,12 @@
import { enforceCatchType } from "./enforce-catch-type.js";
import { noEmptyFunction } from "./no-empty-function.js";
export default {
meta: {
name: "local-rules",
},
rules: {
"enforce-catch-type": enforceCatchType,
"no-empty-function": noEmptyFunction,
},
};

View File

@@ -1,170 +0,0 @@
import js from "@eslint/js";
import importPlugin from "eslint-plugin-import";
import perfectionist from "eslint-plugin-perfectionist";
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import { enforceCatchType } from "./eslint-rules/enforce-catch-type.js";
import { noEmptyFunction } from "./eslint-rules/no-empty-function.js";
const noDirectConsoleMessage =
"后端运行时代码禁止直接使用 console.*;请通过注入的 Logger 实例输出日志,配置加载失败前使用 createConsoleFallback()。";
const noDirectConsoleFrontendMessage =
"前端代码禁止直接使用 console.*;请使用 useLogger() hook组件内或 createConsoleLogger()(非组件纯函数)。";
export default tseslint.config(
{
ignores: [
"node_modules/**",
"dist/**",
".build/**",
"*.bun-build",
"openspec/**",
".opencode/**",
".claude/**",
".codex/**",
".agents/**",
".worktrees/**",
"bin/**",
"bun.lock",
"data/**",
"eslint-rules/**",
],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylisticTypeChecked,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
perfectionist.configs["recommended-natural"],
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
settings: {
"import/resolver": { node: true, typescript: true },
},
},
{
rules: {
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
"@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
"@typescript-eslint/only-throw-error": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"import/no-unresolved": ["error", { ignore: ["^bun:"] }],
"no-restricted-syntax": [
"error",
{
message:
"禁止 throw 字面量。项目约定只允许 throw new Error(...) 或 throw new AppError(msg, statusCode)。Re-throw 已捕获的 Error 实例时使用 throw e。",
selector: "ThrowStatement > Literal",
},
],
"no-undef": "off",
},
},
{
files: ["src/**/*.{ts,tsx}"],
plugins: {
local: {
rules: {
"enforce-catch-type": enforceCatchType,
"no-empty-function": noEmptyFunction,
},
},
},
rules: {
"local/enforce-catch-type": "warn",
"local/no-empty-function": "error",
},
},
{
files: ["eslint.config.js"],
rules: {
"import/no-named-as-default": "off",
"import/no-named-as-default-member": "off",
},
},
{
files: ["src/server/db/**/*.ts"],
ignores: ["src/server/db/helpers.ts"],
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
importNames: ["sqliteTable"],
message:
"请从 ./helpers.ts 导入 sqliteTable并在列定义中展开 baseColumns。参见 src/server/db/helpers.ts。",
name: "drizzle-orm/sqlite-core",
},
],
},
],
},
},
{
files: ["src/server/**/*.ts"],
ignores: ["src/server/logger.ts"],
rules: {
"no-restricted-syntax": [
"error",
{
message: noDirectConsoleMessage,
selector: "MemberExpression[object.name='console']",
},
],
},
},
{
files: ["src/web/**/*.{ts,tsx}"],
ignores: ["src/web/**/logger.ts"],
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
"no-restricted-imports": [
"error",
{
patterns: [
{
group: [
"../server/*",
"../server/**",
"../**/server/*",
"../**/server/**",
"../../server/*",
"../../server/**",
"src/server/*",
"src/server/**",
],
message: "前端不得导入 src/server 后端运行时实现;请改用 src/shared 类型或 HTTP API。",
},
],
},
],
"no-restricted-syntax": [
"error",
{
message: noDirectConsoleFrontendMessage,
selector: "MemberExpression[object.name='console']",
},
],
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
},
},
eslintPluginPrettierRecommended,
);

View File

@@ -8,9 +8,9 @@
"dev:server": "bun --watch src/server/dev.ts",
"dev:web": "bunx --bun vite --host",
"build": "bun run scripts/build.ts",
"lint": "eslint .",
"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "oxlint --deny-warnings",
"format": "oxfmt",
"format:check": "oxfmt --check",
"check": "bun run schema:check && bun run typecheck && bun run lint && bun test",
"schema": "bun run scripts/generate-config-schema.ts",
"schema:check": "bun run scripts/generate-config-schema.ts -- --check",
@@ -27,7 +27,6 @@
"devDependencies": {
"@commitlint/cli": "^21.0.1",
"@commitlint/config-conventional": "^21.0.1",
"@eslint/js": "^10.0.1",
"@tanstack/react-query-devtools": "^5.100.14",
"@testing-library/react": "^16.3.2",
"@types/bun": "^1.3.14",
@@ -36,20 +35,13 @@
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.2",
"drizzle-kit": "^0.31.10",
"eslint": "^10.4.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-perfectionist": "^5.9.0",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.2",
"husky": "^9.1.7",
"jsdom": "^29.1.1",
"lint-staged": "^17.0.5",
"prettier": "^3.8.3",
"oxfmt": "^0.53.0",
"oxlint": "^1.68.0",
"oxlint-tsgolint": "^0.23.0",
"typescript": "^6.0.3",
"typescript-eslint": "^8.60.0",
"vite": "^8.0.14"
},
"dependencies": {

View File

@@ -19,6 +19,24 @@
"skillPath": "skills/antd/SKILL.md",
"computedHash": "4295010f09f85855cab9e9de9ec7f96c14541474b4f3f9d6ef89006430931b94"
},
"migrate-oxfmt": {
"source": "oxc-project/oxc",
"sourceType": "github",
"skillPath": ".agents/skills/migrate-oxfmt/SKILL.md",
"computedHash": "b3ae0d11b61d07471cf466ba0386490a9f7ed5c1186d4956a58ac55a4b6be6ad"
},
"migrate-oxlint": {
"source": "oxc-project/oxc",
"sourceType": "github",
"skillPath": ".agents/skills/migrate-oxlint/SKILL.md",
"computedHash": "efb0bcf1c44791ba292d0536eaef87fac535c1fcc5df3280bd7a79d049b8644c"
},
"performance-lint-rules": {
"source": "oxc-project/oxc",
"sourceType": "github",
"skillPath": ".agents/skills/performance-lint-rules/SKILL.md",
"computedHash": "0572ca4dfdaa5545a5473b1451d255796bd088418ddbc2a8dbddff68ef34a640"
},
"react-router-data-mode": {
"source": "remix-run/agent-skills",
"sourceType": "github",

View File

@@ -1,5 +1,5 @@
import { isNumber, isString } from "es-toolkit";
import { dirname, isAbsolute, resolve } from "node:path";
import { isNumber, isString } from "es-toolkit";
import type { ConfigValidationIssue } from "./config/issues";
import type { LoggingConfig, LogLevel, ResolvedConfig, ResolvedLoggingConfig, RotationFrequency } from "./config/types";

View File

@@ -2,9 +2,9 @@ import type { Column, SQL } from "drizzle-orm";
import type { SQLiteTable } from "drizzle-orm/sqlite-core";
import Database from "bun:sqlite";
import { join } from "node:path";
import { and, eq, isNull, sql } from "drizzle-orm";
import { drizzle } from "drizzle-orm/bun-sqlite";
import { join } from "node:path";
import type { Logger } from "../logger";

View File

@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/require-await */
/* oxlint-disable typescript/require-await */
import { afterEach, describe, expect, test } from "bun:test";
import { mkdirSync } from "node:fs";
import { tmpdir } from "node:os";

View File

@@ -1,5 +1,5 @@
import { screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { screen } from "@testing-library/react";
import { createElement } from "react";
import { APP } from "../../src/shared/app";

View File

@@ -1,5 +1,5 @@
import { fireEvent } from "@testing-library/react";
import { describe, expect, it, vi } from "bun:test";
import { fireEvent } from "@testing-library/react";
import { createElement } from "react";
import { FilterToolbar } from "../../src/web/shared/components/FilterToolbar";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test, vi } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Model, Project } from "../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, mock, test } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Conversation, Model } from "../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { screen } from "@testing-library/react";
import { createElement } from "react";
import { ConsoleShell } from "../../../src/web/shared/components/ConsoleShell/ConsoleShell";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test, vi } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Conversation } from "../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test, vi } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Conversation } from "../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test, vi } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import { ConversationSidebar } from "../../../src/web/features/chat/components/ConversationSidebar";

View File

@@ -1,6 +1,6 @@
import { describe, expect, test } from "bun:test";
import { fireEvent, render, screen } from "@testing-library/react";
import { App as AntApp, ConfigProvider } from "antd";
import { describe, expect, test } from "bun:test";
import { createElement } from "react";
import { ErrorBoundary } from "../../../src/web/shared/components/ErrorBoundary";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, mock, test } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Model, Provider, ProviderOption } from "../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { fireEvent, screen } from "@testing-library/react";
import { createElement } from "react";
import { useLocation } from "react-router";

View File

@@ -1,5 +1,5 @@
import { screen, waitFor } from "@testing-library/react";
import { describe, expect, mock, test } from "bun:test";
import { screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import { renderWithProviders } from "../../test-utils";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { fireEvent, screen } from "@testing-library/react";
import { createElement } from "react";
import { ReasoningPart } from "../../../../src/web/features/chat/parts/ReasoningPart";

View File

@@ -1,5 +1,5 @@
import { screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { screen } from "@testing-library/react";
import { createElement } from "react";
import { TextPart } from "../../../../src/web/features/chat/parts/TextPart";

View File

@@ -1,5 +1,5 @@
import { screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { screen } from "@testing-library/react";
import { createElement } from "react";
import { ToolPart } from "../../../../src/web/features/chat/parts/ToolPart";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test, vi } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { CreateMaterialRequest, Material } from "../../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Project } from "../../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test, vi } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Material } from "../../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { screen } from "@testing-library/react";
import { describe, expect, test, vi } from "bun:test";
import { screen } from "@testing-library/react";
import { createElement } from "react";
import type { Material } from "../../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { screen, waitFor } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import { SettingsPage } from "../../../../src/web/features/settings/index";

View File

@@ -1,7 +1,7 @@
import type { UIMessage } from "ai";
import { act, renderHook } from "@testing-library/react";
import { describe, expect, mock, test } from "bun:test";
import { act, renderHook } from "@testing-library/react";
import { useChatScroll } from "../../../src/web/features/chat/use-chat-scroll";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { fireEvent, screen } from "@testing-library/react";
import { createElement } from "react";
import { useLocation } from "react-router";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, mock, test } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Model, Provider } from "../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, mock, test } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import { useLocation } from "react-router";

View File

@@ -1,5 +1,5 @@
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { fireEvent, screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import type { Provider } from "../../../src/shared/api";

View File

@@ -1,5 +1,5 @@
import { screen, waitFor } from "@testing-library/react";
import { describe, expect, test } from "bun:test";
import { screen, waitFor } from "@testing-library/react";
import { createElement } from "react";
import { App } from "../../../src/web/app";

View File

@@ -1,8 +1,8 @@
import { mock } from "bun:test";
import { XProvider } from "@ant-design/x";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { render } from "@testing-library/react";
import { App } from "antd";
import { mock } from "bun:test";
import { createElement, StrictMode } from "react";
import { MemoryRouter } from "react-router";

View File

@@ -1,7 +1,7 @@
import { describe, expect, it } from "bun:test";
import { XProvider } from "@ant-design/x";
import { act, renderHook } from "@testing-library/react";
import { App } from "antd";
import { describe, expect, it } from "bun:test";
import { createElement } from "react";
import { useConfirmAction } from "../../src/web/shared/hooks/useConfirmAction";

View File

@@ -1,5 +1,5 @@
import { act, renderHook } from "@testing-library/react";
import { describe, expect, it } from "bun:test";
import { act, renderHook } from "@testing-library/react";
import { createElement } from "react";
import { MemoryRouter, Route, Routes } from "react-router";