Skip to content

Commit daed549

Browse files
lint
1 parent 3327659 commit daed549

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/web/src/terminal-links.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,18 @@ function inferHomeFromCwd(cwd: string): string | undefined {
115115
return undefined;
116116
}
117117

118-
function splitPathAndPosition(value: string): { path: string; line?: string; column?: string } {
118+
function splitPathAndPosition(value: string): {
119+
path: string;
120+
line: string | undefined;
121+
column: string | undefined;
122+
} {
119123
let path = value;
120124
let column: string | undefined;
121125
let line: string | undefined;
122126

123127
const columnMatch = path.match(/:(\d+)$/);
124128
if (!columnMatch?.[1]) {
125-
return { path };
129+
return { path, line: undefined, column: undefined };
126130
}
127131

128132
column = columnMatch[1];
@@ -176,10 +180,7 @@ export function resolvePathLinkTarget(rawPath: string, cwd: string): string {
176180
}
177181

178182
export function preferredTerminalEditor(): EditorId {
179-
const fallback =
180-
EDITORS.find((editor) => editor.command)?.id ??
181-
EDITORS[0]?.id ??
182-
"cursor";
183+
const fallback = EDITORS.find((editor) => editor.command)?.id ?? EDITORS[0]?.id ?? "cursor";
183184

184185
if (typeof window === "undefined") {
185186
return fallback;

0 commit comments

Comments
 (0)