From be6320c8b407ba3914c389f2dada585218f3c4ea Mon Sep 17 00:00:00 2001 From: tianzhou Date: Fri, 26 Jun 2026 01:59:08 -0700 Subject: [PATCH 1/2] chore: clean up mechanical lint debt --- server/index.ts | 1 - server/lib/connection-cache.ts | 4 +- server/lib/schema-cache.ts | 2 +- server/services/query-service.ts | 4 +- src/components/Gutter.tsx | 7 ++-- src/components/sql-editor/ObjectTree.tsx | 2 +- src/components/sql-editor/pg-autocomplete.ts | 4 +- src/components/ui/command.tsx | 5 ++- src/components/ui/sheet.tsx | 1 + src/lib/auth-client.ts | 4 +- .../sql/autocomplete/candidate-generator.ts | 5 +-- src/lib/sql/autocomplete/scope-analyzer.ts | 13 +++---- src/lib/sql/autocomplete/section-detector.ts | 2 +- src/lib/sql/core.ts | 4 +- src/lib/sql/format.ts | 38 +++++++++---------- .../components/sections/faqs-accordion.tsx | 2 +- .../sections/faqs-two-column-accordion.tsx | 2 +- .../components/sections/stats-with-graph.tsx | 2 +- 18 files changed, 52 insertions(+), 50 deletions(-) diff --git a/server/index.ts b/server/index.ts index 240c31b..b24b2c1 100644 --- a/server/index.ts +++ b/server/index.ts @@ -13,7 +13,6 @@ declare const __dirname: string // Injected by esbuild define declare const __APP_VERSION__: string declare const __DEV__: boolean -declare const __GIT_COMMIT__: string const app = express() // Parse command line arguments diff --git a/server/lib/connection-cache.ts b/server/lib/connection-cache.ts index 00a2a28..f6e5dbd 100644 --- a/server/lib/connection-cache.ts +++ b/server/lib/connection-cache.ts @@ -1,3 +1,5 @@ +import type { createClient } from './db' + // In-memory cache for connection runtime information export interface ConnectionInfo { version: string // PostgreSQL major version (e.g., "16") @@ -50,7 +52,7 @@ export function clearConnectionCache(connectionId?: string): void { * @returns PostgreSQL major version (e.g., "16") * @throws Error if version cannot be extracted */ -export async function testAndCacheConnection(client: any, connectionId: string): Promise { +export async function testAndCacheConnection(client: ReturnType, connectionId: string): Promise { // Test connectivity await client`SELECT 1` diff --git a/server/lib/schema-cache.ts b/server/lib/schema-cache.ts index e5110d0..462b969 100644 --- a/server/lib/schema-cache.ts +++ b/server/lib/schema-cache.ts @@ -211,7 +211,7 @@ async function buildSchemaContext( lines.push(`PostgreSQL ${version}`) lines.push('') - for (const [_key, table] of schemaMap) { + for (const table of schemaMap.values()) { // Table header lines.push(`${table.schema}.${table.table} (${table.objectType})`) if (table.comment) { diff --git a/server/services/query-service.ts b/server/services/query-service.ts index 9c17e26..9a5162a 100644 --- a/server/services/query-service.ts +++ b/server/services/query-service.ts @@ -95,7 +95,7 @@ async function getColumnMetadata( } // Get table info, primary key columns, column nullability, and columns with defaults - let tableInfo = new Map; notNullColumns: Set; defaultColumns: Set }>(); + const tableInfo = new Map; notNullColumns: Set; defaultColumns: Set }>(); if (tableOids.length > 0) { const tableRows = await client` SELECT @@ -1072,8 +1072,6 @@ export const queryServiceHandlers: ServiceImpl = { // Check which objects are referenced in the function definition // Look for patterns like: schema.name, "schema"."name", or just name (for tables in search_path) const deps: Array<{ schema: string; name: string; type: string; arguments: string }> = []; - const definitionLower = definition.toLowerCase(); - for (const obj of objectsResult) { const schema = obj.schema as string; const name = obj.name as string; diff --git a/src/components/Gutter.tsx b/src/components/Gutter.tsx index 3932130..166a757 100644 --- a/src/components/Gutter.tsx +++ b/src/components/Gutter.tsx @@ -1,5 +1,4 @@ -import { Home, Settings } from 'lucide-react' -import type { ComponentType } from 'react' +import { Home, Settings, type LucideIcon } from 'lucide-react' import { useNavigate, useLocation } from 'react-router-dom' import { Button } from './ui/button' import { useMemo } from 'react' @@ -41,12 +40,12 @@ export default function Gutter({ activeItem, onItemClick }: GutterProps) { } } - const gutterIcons: { id: GutterItem; Icon: ComponentType<{ size?: number }>; label: string }[] = [ + const gutterIcons: { id: GutterItem; Icon: LucideIcon; label: string }[] = [ { id: 'home', Icon: Home, label: 'Organization Home' }, { id: 'settings', Icon: Settings, label: 'Organization Settings' }, ] - const renderButton = ({ id, Icon, label }: { id: GutterItem; Icon: ComponentType; label: string }) => { + const renderButton = ({ id, Icon, label }: { id: GutterItem; Icon: LucideIcon; label: string }) => { const isActive = activeItem === id return (