Skip to content

Commit 7d38408

Browse files
committed
fix: resolve all ESLint errors failing CI
Remove unused imports/variables, fix inline import() type annotations, replace unnecessary type assertions, and add eslint-disable for intentional require() calls in tree-sitter/sqlite native module loading.
1 parent 2f418eb commit 7d38408

17 files changed

+34
-23
lines changed

src/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ async function legacyRun(instruction: string, options: RunOptions): Promise<void
716716
// ── Duplicate write nudge ──────────────────────────────────────
717717
// If the model has written the same file 3+ times, nudge it to move on.
718718
if (!wasError && tc.name === 'write_file' && typeof tc.arguments['path'] === 'string') {
719-
const wPath = tc.arguments['path'] as string;
719+
const wPath = tc.arguments['path'];
720720
fileWriteCounts.set(wPath, (fileWriteCounts.get(wPath) ?? 0) + 1);
721721
if (fileWriteCounts.get(wPath)! >= 3) {
722722
stderrLog(formatInternalStatus(

src/commands/trace.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
formatImpactReport,
2525
} from '../trace/index.js';
2626
import type { CliOverrides } from '../config/schema.js';
27+
import type { ChalkInstance } from 'chalk';
2728

2829
export interface TraceOptions extends CliOverrides {
2930
depth?: number;
@@ -78,7 +79,7 @@ async function runTraceV2(
7879
symbolName: string,
7980
options: TraceOptions,
8081
workspaceRoot: string,
81-
chalk: typeof import('chalk').default,
82+
chalk: ChalkInstance,
8283
write: (msg: string) => void,
8384
): Promise<void> {
8485
const indexDir = join(workspaceRoot, '.jam', 'trace-index');
@@ -119,7 +120,7 @@ async function runTraceV2(
119120
const result = traceSymbol(store, symbolName, { depth });
120121

121122
if (result.notFound) {
122-
let errMsg = `Symbol "${symbolName}" not found in the workspace.`;
123+
const errMsg = `Symbol "${symbolName}" not found in the workspace.`;
123124
let hint = 'Check the spelling, or try --reindex to rebuild the index.';
124125
if (result.candidates && result.candidates.length > 0) {
125126
hint += '\n\nDid you mean:';
@@ -248,7 +249,7 @@ async function runTraceLegacy(
248249
symbolName: string,
249250
options: TraceOptions,
250251
workspaceRoot: string,
251-
chalk: typeof import('chalk').default,
252+
chalk: ChalkInstance,
252253
write: (msg: string) => void,
253254
): Promise<void> {
254255
// Build call graph

src/providers/copilot-e2e.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('E2E: jam run with mock Copilot proxy', () => {
3939
});
4040

4141
it('creates all requested Spring Boot files via tool calls', async () => {
42-
const { stdout, stderr } = await execFileAsync(
42+
const { stdout: _stdout, stderr: _stderr } = await execFileAsync(
4343
'node',
4444
[
4545
CLI_PATH,

src/providers/copilot-integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('CopilotProxyBackend integration (text response)', () => {
112112
it('returns text content with no tool calls and correct usage stats', async () => {
113113
const backend = new CopilotProxyBackend({ baseUrl: `http://127.0.0.1:${port}` });
114114

115-
const response = await backend.chatWithTools!(
115+
const response = await backend.chatWithTools(
116116
[{ role: 'user', content: 'Say hello' }],
117117
[] // no tools — plain text scenario
118118
);

src/providers/copilot-sdk-backend.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ function parseToolCalls(text: string): ToolCall[] | undefined {
325325
return [{
326326
id: `call_${Date.now()}`,
327327
name: parsed.tool,
328-
arguments: (parsed.arguments ?? {}) as Record<string, unknown>,
328+
arguments: parsed.arguments ?? {},
329329
}];
330330
}
331331
} catch {

src/trace/cross-language.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function populateStore(store: TraceStore): void {
5151
store.beginTransaction();
5252

5353
// ── PaymentService.java symbols ──────────────────────────────────────────
54-
const paymentServiceId = store.insertSymbol({
54+
store.insertSymbol({
5555
name: 'PaymentService',
5656
kind: 'class',
5757
file: 'PaymentService.java',

src/trace/extractors/base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type Parser from 'tree-sitter';
2-
import type { SymbolRecord, CallRecord, ImportRecord, ColumnRecord } from '../store.js';
2+
import type { SymbolRecord, ImportRecord } from '../store.js';
33

44
/** Records extracted from a single file. */
55
export interface ExtractionResult {

src/trace/extractors/java.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// src/trace/extractors/java.test.ts
2-
import { describe, it, expect, beforeAll } from 'vitest';
2+
import { describe, it, expect } from 'vitest';
33
import { isTreeSitterAvailable, parseSource } from '../parser.js';
44
import './java.js'; // registers JavaExtractor
55
import { getExtractor } from './base.js';

src/trace/extractors/python.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// src/trace/extractors/python.test.ts
2-
import { describe, it, expect, beforeAll } from 'vitest';
2+
import { describe, it, expect } from 'vitest';
33
import { isTreeSitterAvailable, parseSource } from '../parser.js';
44
import './python.js'; // registers PythonExtractor
55
import { getExtractor } from './base.js';

src/trace/extractors/python.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// src/trace/extractors/python.ts
22
import type Parser from 'tree-sitter';
3-
import { registerExtractor, findNodes, findNodesByTypes } from './base.js';
3+
import { registerExtractor, findNodes } from './base.js';
44
import type { Extractor, ExtractionResult } from './base.js';
55

66
/** Walk upward from a node to find the nearest enclosing function_definition. */

0 commit comments

Comments
 (0)