Skip to content

Commit c8ac0e4

Browse files
author
CAL
committed
fix(vscode): replace require() with static imports in SessionPathResolver
Replace runtime require() calls with static imports to fix @typescript-eslint/no-require-imports lint errors in CI.
1 parent 618ae2f commit c8ac0e4

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

sidekick-vscode/src/services/SessionPathResolver.ts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
*/
1212

1313
import * as fs from 'fs';
14+
import * as os from 'os';
1415
import * as path from 'path';
1516

16-
export {
17+
import {
1718
encodeWorkspacePath,
1819
getSessionDirectory,
1920
discoverSessionDirectory,
@@ -26,6 +27,19 @@ export {
2627
getAllProjectFolders,
2728
} from 'sidekick-shared/dist/parsers/sessionPathResolver';
2829

30+
export {
31+
encodeWorkspacePath,
32+
getSessionDirectory,
33+
discoverSessionDirectory,
34+
findActiveSession,
35+
findAllSessions,
36+
findSessionsInDirectory,
37+
findSubdirectorySessionDirs,
38+
getMostRecentlyActiveSessionDir,
39+
decodeEncodedPath,
40+
getAllProjectFolders,
41+
};
42+
2943
// Re-export ProjectFolderInfo from the shared type (used by session providers)
3044
export type { ProjectFolderInfo } from 'sidekick-shared/dist/providers/types';
3145

@@ -51,18 +65,9 @@ export interface SessionDiagnostics {
5165
* VS Code extension-only (used by debug commands).
5266
*/
5367
export function getSessionDiagnostics(workspacePath: string): SessionDiagnostics {
54-
// Import from shared at runtime to avoid circular dependencies
55-
const {
56-
encodeWorkspacePath,
57-
getSessionDirectory,
58-
discoverSessionDirectory,
59-
findSubdirectorySessionDirs,
60-
getMostRecentlyActiveSessionDir,
61-
} = require('sidekick-shared/dist/parsers/sessionPathResolver');
62-
6368
const encodedPath = encodeWorkspacePath(workspacePath);
6469
const expectedSessionDir = getSessionDirectory(workspacePath);
65-
const projectsDir = path.join(require('os').homedir(), '.claude', 'projects');
70+
const projectsDir = path.join(os.homedir(), '.claude', 'projects');
6671

6772
let existingProjectDirs: string[] = [];
6873
let expectedDirExists = false;

0 commit comments

Comments
 (0)