Skip to content

Commit 2f0ea37

Browse files
committed
Fin linter issues
1 parent 4ea969d commit 2f0ea37

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/web/test/suite/documentHelpers.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { Range, TextDocument } from 'vscode';
44
import { adjustedRangeWithMinimumIndentation, contentOfLinesWithAdjustedIndentation, endOfLineCharacter, linesForIndexes, minimumIndentationForLineIndexes } from '../../../lib/documentHelpers';
55

66
const fixtureUri = (fileName: string) => {
7-
const workspaceFolder = vscode.workspace.workspaceFolders![0];
7+
const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
8+
if (!workspaceFolder) { throw new Error('No workspace folder found'); }
9+
810
return vscode.Uri.joinPath(workspaceFolder.uri, fileName);
911
};
1012

src/web/test/suite/textHelpers.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import { generateCopyableText, generateSnippet, includeLanguageIdentifier, isMar
66
import { ExtensionConfig } from '../../../types/config';
77

88
const fixtureUri = (fileName: string) => {
9-
const workspaceFolder = vscode.workspace.workspaceFolders![0];
9+
const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
10+
if (!workspaceFolder) { throw new Error('No workspace folder found'); }
11+
1012
return vscode.Uri.joinPath(workspaceFolder.uri, fileName);
1113
};
1214

0 commit comments

Comments
 (0)