diff --git a/src/agent-tools/graphExplorer.ts b/src/agent-tools/graphExplorer.ts index d15f501..7eaa14e 100644 --- a/src/agent-tools/graphExplorer.ts +++ b/src/agent-tools/graphExplorer.ts @@ -4,7 +4,6 @@ */ import { DynamicStructuredTool } from "@langchain/core/tools"; -// @ts-ignore - graphology type issue import type Graph from "graphology"; import { z } from "zod"; @@ -20,7 +19,7 @@ const graphExplorerSchema = z.object({ * Creates the graph explorer tool. * @param graph - Graphology graph instance */ -// @ts-ignore - Graph type issue +// @ts-expect-error - Graph type issue export function createGraphExplorerTool(graph: Graph) { return new DynamicStructuredTool({ name: "ask262_graph_explorer", diff --git a/src/setup/buildGraph.ts b/src/setup/buildGraph.ts index 2aea3b9..397aff0 100644 --- a/src/setup/buildGraph.ts +++ b/src/setup/buildGraph.ts @@ -21,7 +21,7 @@ import { GRAPH_FILE } from "../constants.js"; */ async function buildGraph() { // Initialize a multi-graph (allows multiple edges between same nodes) - // @ts-ignore - graphology constructor type issue + // @ts-expect-error - graphology constructor type issue const graph = new Graph({ multi: true, type: "directed", diff --git a/src/setup/htmlAddInternalMethodLink.ts b/src/setup/htmlAddInternalMethodLink.ts index 6ed6c99..d41c3c0 100644 --- a/src/setup/htmlAddInternalMethodLink.ts +++ b/src/setup/htmlAddInternalMethodLink.ts @@ -1,8 +1,8 @@ #!/usr/bin/env bun +import { readFileSync, writeFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; import type { CheerioAPI } from "cheerio"; import * as cheerio from "cheerio"; -import { readFileSync, writeFileSync } from "fs"; -import { fileURLToPath } from "url"; // Resolve the path to the HTML file (relative to repo root) const htmlUrl = new URL( diff --git a/src/setup/utils/formatHTMLForIngestion.ts b/src/setup/utils/formatHTMLForIngestion.ts index 729e82d..9e7f775 100644 --- a/src/setup/utils/formatHTMLForIngestion.ts +++ b/src/setup/utils/formatHTMLForIngestion.ts @@ -266,17 +266,17 @@ export function convertTablesToMarkdown($: cheerio.CheerioAPI): void { // Header row if (rows.length > 0) { const header = rows[0].concat(Array(maxCols - rows[0].length).fill("")); - mdLines.push("| " + header.join(" | ") + " |"); + mdLines.push(`| ${header.join(" | ")} |`); } // Separator - mdLines.push("|" + Array(maxCols).fill(" --- ").join("|") + "|"); + mdLines.push(`|${Array(maxCols).fill(" --- ").join("|")}|`); // Data rows (skip header if we have more rows) const dataRows = rows.length > 1 ? rows.slice(1) : []; for (const row of dataRows) { const padded = row.concat(Array(maxCols - row.length).fill("")); - mdLines.push("| " + padded.join(" | ") + " |"); + mdLines.push(`| ${padded.join(" | ")} |`); } // Replace table with markdown diff --git a/src/test/manual/verify-db.ts b/src/test/manual/verify-db.ts index b73b034..8126097 100644 --- a/src/test/manual/verify-db.ts +++ b/src/test/manual/verify-db.ts @@ -60,7 +60,7 @@ async function getTable(): Promise { // Check if table exists try { return await db.openTable("spec_vectors"); - } catch (error) { + } catch (_error) { console.error("❌ Table 'spec_vectors' not found in database"); console.log("\nRun 'bun run ingest' first to populate the database."); process.exit(1); @@ -97,7 +97,7 @@ program .option("-l, --limit ", "Number of results to show", "5") .action(async (query: string, options: { limit: string }) => { const table = await getTable(); - await vectorSearch(table, query, parseInt(options.limit)); + await vectorSearch(table, query, parseInt(options.limit, 10)); }); program @@ -114,7 +114,7 @@ program .option("-n, --count ", "Number of samples to show", "3") .action(async (options: { count: string }) => { const table = await getTable(); - await showSamples(table, parseInt(options.count)); + await showSamples(table, parseInt(options.count, 10)); }); program @@ -123,7 +123,7 @@ program .option("-m, --min ", "Minimum size in characters", "5000") .action(async (options: { min: string }) => { const table = await getTable(); - await showLargeDocs(table, parseInt(options.min)); + await showLargeDocs(table, parseInt(options.min, 10)); }); async function showSummary(table: Table) { @@ -223,7 +223,7 @@ async function listSections(table: Table) { for (const [id, info] of sorted) { const title = - info.title.length > 50 ? info.title.slice(0, 47) + "..." : info.title; + info.title.length > 50 ? `${info.title.slice(0, 47)}...` : info.title; console.log( `${id.padEnd(30)} | ${title.padEnd(50)} | ${info.chunks.toString().padStart(3)}`, ); @@ -365,7 +365,7 @@ function printTreeNode( const connector = isLast ? "└── " : "├── "; const title = node.sectiontitle.length > 50 - ? node.sectiontitle.slice(0, 47) + "..." + ? `${node.sectiontitle.slice(0, 47)}...` : node.sectiontitle; console.log(`${prefix}${connector}${node.sectionid}`); console.log(`${prefix}${isLast ? " " : "│ "} ${title}`);