Skip to content

Commit fe26058

Browse files
committed
Handle package.json, jsconfig.json, tsconfig.json in the getDiagnostics of fourslash tests
1 parent 8e16bff commit fe26058

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/harness/fourslash.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,17 @@ namespace FourSlash {
507507
}
508508

509509
private getAllDiagnostics(): ts.Diagnostic[] {
510-
return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName =>
511-
ts.isAnySupportedFileExtension(fileName) ? this.getDiagnostics(fileName) : []);
510+
return ts.flatMap(this.languageServiceAdapterHost.getFilenames(), fileName => {
511+
if (!ts.isAnySupportedFileExtension(fileName)) {
512+
return [];
513+
}
514+
515+
const baseName = ts.getBaseFileName(fileName);
516+
if (baseName === "package.json" || baseName === "tsconfig.json" || baseName === "jsconfig.json") {
517+
return [];
518+
}
519+
return this.getDiagnostics(fileName);
520+
});
512521
}
513522

514523
public verifyErrorExistsAfterMarker(markerName: string, shouldExist: boolean, after: boolean) {

0 commit comments

Comments
 (0)