🔨 chore: remove dead eslint disable comments for deleted rules (#12597)

This commit is contained in:
YuTengjing 2026-03-02 23:18:01 +08:00 committed by GitHub
parent 607dfdec96
commit 6ecba929b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 21 additions and 105 deletions

View file

@ -1,3 +1,8 @@
---
name: db-migrations
description: Database migration guide. Use when generating migrations, writing migration SQL, or modifying database schemas. Triggers on migration generation, schema changes, or idempotent SQL questions.
---
# Database Migrations Guide
## Step 1: Generate Migrations
@ -78,3 +83,11 @@ CREATE UNIQUE INDEX IF NOT EXISTS "users_email_unique" ON "users" USING btree ("
DROP TABLE "old_table";
CREATE INDEX "users_email_idx" ON "users" ("email");
```
## Step 4: Regenerate Client After SQL Edits
After modifying the generated SQL (e.g., adding `IF NOT EXISTS`), regenerate the client:
```bash
bun run db:generate:client
```

View file

@ -202,39 +202,4 @@ return { ...dataset, testCases };
## Database Migrations
See `references/db-migrations.md` for detailed migration guide.
```bash
# Generate migrations
bun run db:generate
# After modifying SQL (e.g., adding IF NOT EXISTS)
bun run db:generate:client
```
### Migration Best Practices
All migration SQL must be **idempotent** (safe to re-run):
```sql
-- ✅ Tables: IF NOT EXISTS
CREATE TABLE IF NOT EXISTS "agent_eval_runs" (...);
-- ✅ Columns: IF NOT EXISTS / IF EXISTS
ALTER TABLE "users" ADD COLUMN IF NOT EXISTS "avatar" text;
ALTER TABLE "users" DROP COLUMN IF EXISTS "old_field";
-- ✅ Foreign keys: DROP IF EXISTS + ADD (no IF NOT EXISTS for constraints)
ALTER TABLE "t" DROP CONSTRAINT IF EXISTS "t_fk";
ALTER TABLE "t" ADD CONSTRAINT "t_fk" FOREIGN KEY ("col") REFERENCES "ref"("id") ON DELETE cascade;
-- ✅ Indexes: IF NOT EXISTS
CREATE INDEX IF NOT EXISTS "users_email_idx" ON "users" ("email");
-- ❌ Non-idempotent (will fail on re-run)
CREATE TABLE "agent_eval_runs" (...);
ALTER TABLE "users" ADD COLUMN "avatar" text;
ALTER TABLE "t" ADD CONSTRAINT "t_fk" FOREIGN KEY ...;
```
Rename migration files meaningfully: `0046_meaningless.sql``0046_user_add_avatar.sql`
See the `db-migrations` skill for the detailed migration guide.

12
.vscode/settings.json vendored
View file

@ -6,17 +6,9 @@
},
"editor.formatOnSave": true,
// don't show errors, but fix when save and git pre commit
"eslint.rules.customizations": [
// { "rule": "import/order", "severity": "off" },
// { "rule": "prettier/prettier", "severity": "off" },
// { "rule": "react/jsx-sort-props", "severity": "off" },
// { "rule": "sort-keys-fix/sort-keys-fix", "severity": "off" },
// { "rule": "simple-import-sort/exports", "severity": "off" },
// { "rule": "typescript-sort-keys/interface", "severity": "off" }
],
"eslint.rules.customizations": [],
"eslint.validate": [
// vscode eslint not
// "json",
"json",
"javascript",
"javascriptreact",
"typescript",

View file

@ -4,7 +4,6 @@ import { systemPrompt } from './systemRole';
import { AgentManagementApiName, AgentManagementIdentifier } from './types';
export const AgentManagementManifest: BuiltinToolManifest = {
/* eslint-disable sort-keys-fix/sort-keys-fix */
api: [
// ==================== Agent CRUD ====================
{

View file

@ -92,7 +92,6 @@ export const GroupAgentBuilderManifest: BuiltinToolManifest = {
description: 'Array of agent definitions to create',
items: {
properties: {
/* eslint-disable sort-keys-fix/sort-keys-fix */
avatar: {
description: "An emoji or image URL for the agent's avatar (optional).",
type: 'string',
@ -116,7 +115,6 @@ export const GroupAgentBuilderManifest: BuiltinToolManifest = {
items: { type: 'string' },
type: 'array',
},
/* eslint-enable sort-keys-fix/sort-keys-fix */
},
required: ['avatar', 'title', 'description', 'systemRole'],
type: 'object',

View file

@ -7,7 +7,6 @@ import { GroupManagementApiName } from './types';
export const GroupManagementIdentifier = 'lobe-group-management';
export const GroupManagementManifest: BuiltinToolManifest = {
/* eslint-disable sort-keys-fix/sort-keys-fix */
api: [
// ==================== Communication Coordination ====================
{

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
/**
* API names for Group Management tool

View file

@ -64,7 +64,6 @@ export const createActions = (
...initialState,
items: defaultItems.map((item) => ({ ...item, id: generateId() })),
/* eslint-disable sort-keys-fix/sort-keys-fix */
addItem: () => {
const { items, newItemText } = get();
if (!newItemText.trim()) return;

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import type { BuiltinToolManifest } from '@lobechat/types';
import { systemPrompt } from './systemRole';

View file

@ -3,7 +3,6 @@
*/
export const PageAgentIdentifier = 'lobe-page-agent';
/* eslint-disable sort-keys-fix/sort-keys-fix */
export const DocumentApiName = {
// Initialize
initPage: 'initPage',
@ -20,7 +19,6 @@ export const DocumentApiName = {
// Text Operations
replaceText: 'replaceText',
};
/* eslint-enable sort-keys-fix/sort-keys-fix */
// ============ State Types for Renders ============

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
export const cloudModelIdMapping: Record<string, string> = {
// 'claude-sonnet-4-5-20250929': 'us.anthropic.claude-sonnet-4-5-20250929-v1:0',

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import type { ExecutionConditions } from '@lobechat/types';
import { boolean, index, integer, jsonb, pgTable, text, timestamp } from 'drizzle-orm/pg-core';

View file

@ -1,5 +1,4 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { SkillManifest, SkillResourceMeta } from '@lobechat/types';
import type { SkillManifest, SkillResourceMeta } from '@lobechat/types';
import { relations } from 'drizzle-orm';
import { index, jsonb, pgTable, text, uniqueIndex, varchar } from 'drizzle-orm/pg-core';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import type { AiProviderConfig, AiProviderSettings } from '@lobechat/types';
import {
boolean,

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { boolean, index, pgTable, text, varchar } from 'drizzle-orm/pg-core';
import { createInsertSchema } from 'drizzle-zod';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { index, integer, jsonb, pgTable, text, uuid } from 'drizzle-orm/pg-core';
import { timestamps } from './_helpers';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import {
boolean,
index,

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { isNotNull } from 'drizzle-orm';
import type { AnyPgColumn } from 'drizzle-orm/pg-core';
import {

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import type { GenerationAsset } from '@lobechat/types';
import { index, integer, jsonb, pgTable, text, uuid, varchar } from 'drizzle-orm/pg-core';
import { createInsertSchema } from 'drizzle-zod';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import type { GroundingSearch, ModelReasoning, ToolIntervention } from '@lobechat/types';
import {
boolean,

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { boolean, index, jsonb, pgTable, primaryKey, text, varchar } from 'drizzle-orm/pg-core';
import { createInsertSchema, createSelectSchema } from 'drizzle-zod';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import {
index,
integer,

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { DEFAULT_MODEL } from '@lobechat/const';
import { EvalEvaluationStatus } from '@lobechat/types';
import { index, integer, jsonb, pgTable, text, uuid } from 'drizzle-orm/pg-core';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { boolean, index, jsonb, pgTable, primaryKey, text, timestamp } from 'drizzle-orm/pg-core';
import { createNanoId } from '../utils/idGenerator';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { boolean, index, integer, pgTable, text, uniqueIndex, varchar } from 'drizzle-orm/pg-core';
import { createInsertSchema } from 'drizzle-zod';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { DEFAULT_PREFERENCE } from '@lobechat/const';
import type { CustomPluginParams, UserOnboarding } from '@lobechat/types';
import type { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { bigint, index, jsonb, numeric, pgTable, real, text, vector } from 'drizzle-orm/pg-core';
import { idGenerator } from '../../utils/idGenerator';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { index, integer, jsonb, pgTable, text, uniqueIndex } from 'drizzle-orm/pg-core';
import { createNanoId } from '../../utils/idGenerator';

View file

@ -8,7 +8,6 @@ export default defineConfig({
},
test: {
alias: {
/* eslint-disable sort-keys-fix/sort-keys-fix */
'@/const': resolve(__dirname, '../const/src'),
'@/utils/errorResponse': resolve(__dirname, '../../src/utils/errorResponse'),
'@/utils': resolve(__dirname, '../utils/src'),
@ -16,7 +15,7 @@ export default defineConfig({
'@/libs/model-runtime': resolve(__dirname, '../model-runtime/src'),
'@/types': resolve(__dirname, '../types/src'),
'@': resolve(__dirname, '../../src'),
/* eslint-enable */
},
environment: 'happy-dom',
exclude: [

View file

@ -4,7 +4,6 @@ import { coverageConfigDefaults, defineConfig } from 'vitest/config';
export default defineConfig({
test: {
alias: {
/* eslint-disable sort-keys-fix/sort-keys-fix */
'@/const': resolve(__dirname, '../const/src'),
'@/utils/errorResponse': resolve(__dirname, '../../src/utils/errorResponse'),
'@/utils': resolve(__dirname, '../utils/src'),
@ -12,7 +11,7 @@ export default defineConfig({
'@/libs/model-runtime': resolve(__dirname, '../model-runtime/src'),
'@/types': resolve(__dirname, '../types/src'),
'@': resolve(__dirname, '../../src'),
/* eslint-enable */
},
coverage: {
all: false,

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import type { BusinessEdgeConfigData } from '@lobechat/business-config/server';
/**

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import type { Simplify } from 'type-fest';
import { z } from 'zod';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import type { Simplify } from 'type-fest';
import { z } from 'zod';

View file

@ -21,7 +21,6 @@ import type {
TextToSpeechPayload,
} from '../types';
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
export interface LobeRuntimeAI {
baseURL?: string;
chat?: (payload: ChatStreamPayload, options?: ChatMethodOptions) => Promise<Response>;

View file

@ -553,7 +553,6 @@ const transformOpenAIStream = (
const err = e as Error;
/* eslint-disable sort-keys-fix/sort-keys-fix */
const errorData = {
body: {
message:

View file

@ -179,7 +179,6 @@ const transformOpenAIStream = (
const err = e as Error;
/* eslint-disable sort-keys-fix/sort-keys-fix */
const errorData = {
body: {
message:

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { CREDITS_PER_DOLLAR, USD_TO_CNY } from '@lobechat/const/currency';
import type { ModelTokensUsage } from '@lobechat/types';
import debug from 'debug';

View file

@ -25,7 +25,6 @@ export interface GithubModelCard {
version: string;
}
/* eslint-enable typescript-sort-keys/interface */
export const params = {
baseURL: 'https://models.github.ai/inference',

View file

@ -50,7 +50,6 @@ interface Depth {
}
export interface TogetherAIModel {
// eslint-disable-next-line typescript-sort-keys/interface
access: string;
config: Config;
context_length: number;

View file

@ -3,7 +3,6 @@ import { AgentRuntimeErrorType } from '@lobechat/types';
export const AGENT_RUNTIME_ERROR_SET = new Set<string>(Object.values(AgentRuntimeErrorType));
/* eslint-disable sort-keys-fix/sort-keys-fix */
export const StandardErrorType = {
// ******* Client Error ******* //
BadRequest: 400,

View file

@ -1,4 +1,3 @@
/* eslint-disable typescript-sort-keys/interface */
import type { ModelUsage } from '@lobechat/types';
import type { RuntimeImageGenParams } from 'model-bank';

View file

@ -1,4 +1,3 @@
/* eslint-disable typescript-sort-keys/interface */
import { RuntimeVideoGenParams } from 'model-bank';
export type CreateVideoPayload = {

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
import { env } from 'node:process';
import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
// ******* Runtime Biz Error ******* //
export const AgentRuntimeErrorType = {
AgentRuntimeError: 'AgentRuntimeError', // Agent Runtime module runtime error

View file

@ -1,4 +1,3 @@
/* eslint-disable typescript-sort-keys/interface */
export interface ClientSecretPayload {
/**
* Represents the user's API key

View file

@ -75,7 +75,6 @@ export interface MessageMapContext {
topicId?: string | null;
}
/* eslint-disable typescript-sort-keys/interface */
/**
* Context for identifying a conversation or message list
* This is the standard type for all conversation-related context passing

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import type { ILobeAgentRuntimeErrorType } from './agentRuntime';
export const ChatErrorType = {

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
/**
* Message group type

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
import { z } from 'zod';
import { PageSelection, PageSelectionSchema } from './pageSelection';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
import { z } from 'zod';
/**

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
import type { GroundingSearch } from '../../search';
import type { MessageMetadata, ModelReasoning, ToolIntervention } from '../common';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix */
import { z } from 'zod';
import type { GroundingSearch } from '../../search';

View file

@ -1,4 +1,3 @@
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
import { z } from 'zod';
import type { ConversationContext } from '../../conversation';

View file

@ -26,7 +26,6 @@ export interface CustomPluginParams {
serverUrl: string;
};
/* eslint-disable sort-keys-fix/sort-keys-fix , typescript-sort-keys/interface */
manifestMode?: 'local' | 'url';
manifestUrl?: string;
/**

View file

@ -4,11 +4,10 @@ import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
alias: {
/* eslint-disable sort-keys-fix/sort-keys-fix */
'@/const': resolve(__dirname, '../const/src'),
'@/utils': resolve(__dirname, './src'),
'@': resolve(__dirname, '../../src'),
/* eslint-enable */
},
coverage: {
all: false,

View file

@ -58,7 +58,7 @@ export default defineConfig({
'@': resolve(__dirname, './src'),
'~test-utils': resolve(__dirname, './tests/utils.tsx'),
'lru_map': resolve(__dirname, './tests/mocks/lru_map'),
/* eslint-enable */
},
coverage: {
all: false,