Skip to content

Commit ca5b1be

Browse files
committed
run eslint on all files
1 parent 1efd144 commit ca5b1be

File tree

497 files changed

+2375
-1684
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

497 files changed

+2375
-1684
lines changed

.agents/types/agent-config.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export interface AgentConfig {
137137
* }
138138
*/
139139
handleSteps?: (
140-
context: AgentStepContext
140+
context: AgentStepContext,
141141
) => Generator<
142142
ToolCall | 'STEP' | 'STEP_ALL',
143143
void,

backend/src/__tests__/agent-id-resolution.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { describe, expect, it, beforeEach } from 'bun:test'
2-
import { AgentRegistry } from '../templates/agent-registry'
31
import { resolveAgentId } from '@codebuff/common/util/agent-name-normalization'
2+
import { describe, expect, it, beforeEach } from 'bun:test'
3+
4+
import type { AgentRegistry } from '../templates/agent-registry'
45

56
describe('Agent ID Resolution', () => {
67
let mockRegistry: AgentRegistry

backend/src/__tests__/credit-conversion.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { describe, it, expect, mock } from 'bun:test'
21
import {
32
getUserCostPerCredit,
43
} from '@codebuff/billing'
54
import {
65
convertCreditsToUsdCents,
76
convertStripeGrantAmountToCredits,
87
} from '@codebuff/common/util/currency'
8+
import { describe, it, expect } from 'bun:test'
99

1010
describe('Credit Conversion System', () => {
1111
describe('getUserCostPerCredit', () => {

backend/src/__tests__/fast-rewrite.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import path from 'path'
2+
13
import { TEST_USER_ID } from '@codebuff/common/constants'
24
import {
35
clearMockedModules,
46
mockModule,
57
} from '@codebuff/common/testing/mock-modules'
68
import { afterAll, beforeAll, describe, expect, it } from 'bun:test'
79
import { createPatch } from 'diff'
8-
import path from 'path'
10+
911
import { rewriteWithOpenAI } from '../fast-rewrite'
1012

1113
describe.skip('rewriteWithOpenAI', () => {

backend/src/__tests__/generate-diffs-prompt.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { expect, describe, it } from 'bun:test'
2+
23
import { parseAndGetDiffBlocksSingleFile } from '../generate-diffs-prompt'
34

45
describe('parseAndGetDiffBlocksSingleFile', () => {

backend/src/__tests__/live-user-inputs.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { describe, it, expect, beforeEach, afterEach } from 'bun:test'
2+
23
import {
34
startUserInput,
45
cancelUserInput,
5-
endUserInput,
66
checkLiveUserInput,
77
setSessionConnected,
88
getLiveUserInputIds,

backend/src/__tests__/main-prompt.integration.test.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import { TEST_USER_ID } from '@codebuff/common/constants'
2+
3+
4+
// Mock imports needed for setup within the test
5+
import { getToolCallString } from '@codebuff/common/tools/utils'
26
import { getInitialSessionState } from '@codebuff/common/types/session-state'
37
import {
48
afterEach,
@@ -9,20 +13,21 @@ import {
913
mock,
1014
spyOn,
1115
} from 'bun:test'
12-
import { WebSocket } from 'ws'
13-
import { mainPrompt } from '../main-prompt'
1416

15-
// Mock imports needed for setup within the test
16-
import { getToolCallString } from '@codebuff/common/tools/utils'
17-
import { PrintModeObject } from '@codebuff/common/types/print-mode'
18-
import { ProjectFileContext } from '@codebuff/common/util/file'
17+
18+
1919
import * as checkTerminalCommandModule from '../check-terminal-command'
2020
import * as requestFilesPrompt from '../find-files/request-files-prompt'
2121
import * as aisdk from '../llm-apis/vercel-ai-sdk/ai-sdk'
22+
import { mainPrompt } from '../main-prompt'
2223
import { logger } from '../util/logger'
2324
import { renderReadFilesResult } from '../util/parse-tool-call-xml'
2425
import * as websocketAction from '../websockets/websocket-action'
2526

27+
import type { PrintModeObject } from '@codebuff/common/types/print-mode'
28+
import type { ProjectFileContext } from '@codebuff/common/util/file'
29+
import type { WebSocket } from 'ws'
30+
2631
// --- Shared Mocks & Helpers ---
2732

2833
class MockWebSocket {

backend/src/__tests__/main-prompt.test.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import * as bigquery from '@codebuff/bigquery'
22
import * as analytics from '@codebuff/common/analytics'
33
import { TEST_USER_ID } from '@codebuff/common/constants'
4+
import {
5+
clearMockedModules,
6+
mockModule,
7+
} from '@codebuff/common/testing/mock-modules'
8+
import {
9+
getToolCallString,
10+
renderToolResults,
11+
} from '@codebuff/common/tools/utils'
412
import { getInitialSessionState } from '@codebuff/common/types/session-state'
513
import {
614
afterAll,
@@ -13,28 +21,21 @@ import {
1321
mock,
1422
spyOn,
1523
} from 'bun:test'
16-
import { WebSocket } from 'ws'
24+
1725

1826
// Mock imports
1927
import * as checkTerminalCommandModule from '../check-terminal-command'
2028
import * as requestFilesPrompt from '../find-files/request-files-prompt'
29+
import * as getDocumentationForQueryModule from '../get-documentation-for-query'
2130
import * as liveUserInputs from '../live-user-inputs'
2231
import * as aisdk from '../llm-apis/vercel-ai-sdk/ai-sdk'
2332
import { mainPrompt } from '../main-prompt'
2433
import * as processFileBlockModule from '../process-file-block'
25-
26-
import {
27-
clearMockedModules,
28-
mockModule,
29-
} from '@codebuff/common/testing/mock-modules'
30-
import {
31-
getToolCallString,
32-
renderToolResults,
33-
} from '@codebuff/common/tools/utils'
34-
import { ProjectFileContext } from '@codebuff/common/util/file'
35-
import * as getDocumentationForQueryModule from '../get-documentation-for-query'
3634
import * as websocketAction from '../websockets/websocket-action'
3735

36+
import type { ProjectFileContext } from '@codebuff/common/util/file'
37+
import type { WebSocket } from 'ws'
38+
3839
const mockAgentStream = (streamOutput: string) => {
3940
spyOn(aisdk, 'promptAiSdkStream').mockImplementation(async function* () {
4041
yield streamOutput

backend/src/__tests__/parent-instructions.test.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { AgentState } from '@codebuff/common/types/session-state'
2-
import { FileTreeNode, ProjectFileContext } from '@codebuff/common/util/file'
31
import { describe, expect, it } from 'bun:test'
42

5-
import { DynamicAgentTemplate } from '@codebuff/common/types/dynamic-agent-template'
63
import { getAllAgentTemplates } from '../templates/agent-registry'
74
import { collectParentInstructions } from '../templates/strings'
85

6+
import type { DynamicAgentTemplate } from '@codebuff/common/types/dynamic-agent-template'
7+
import type { AgentState } from '@codebuff/common/types/session-state'
8+
import type { FileTreeNode, ProjectFileContext } from '@codebuff/common/util/file'
9+
10+
911
// Helper to create a mock ProjectFileContext
1012
const createMockFileContext = (
1113
agentTemplates: Record<string, DynamicAgentTemplate>

backend/src/__tests__/process-file-block.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { TEST_USER_ID } from '@codebuff/common/constants'
2-
import { cleanMarkdownCodeBlock } from '@codebuff/common/util/file'
3-
import { applyPatch } from '@codebuff/common/util/patch'
4-
import { afterAll, beforeAll, describe, expect, it } from 'bun:test'
5-
62
import {
73
clearMockedModules,
84
mockModule,
95
} from '@codebuff/common/testing/mock-modules'
6+
import { cleanMarkdownCodeBlock } from '@codebuff/common/util/file'
7+
import { applyPatch } from '@codebuff/common/util/patch'
8+
import { afterAll, beforeAll, describe, expect, it } from 'bun:test'
9+
1010
import { processFileBlock } from '../process-file-block'
1111

1212
describe('processFileBlockModule', () => {

0 commit comments

Comments
 (0)