File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -6322,6 +6322,12 @@ namespace ts {
6322
6322
comment . parent = parent ;
6323
6323
}
6324
6324
6325
+ if ( isInJavaScriptFile ( parent ) ) {
6326
+ if ( ! sourceFile . jsDocDiagnostics ) {
6327
+ sourceFile . jsDocDiagnostics = [ ] ;
6328
+ }
6329
+ sourceFile . jsDocDiagnostics . push ( ...parseDiagnostics ) ;
6330
+ }
6325
6331
currentToken = saveToken ;
6326
6332
parseDiagnostics . length = saveParseDiagnosticsLength ;
6327
6333
parseErrorBeforeNextFinishedNode = saveParseErrorBeforeNextFinishedNode ;
Original file line number Diff line number Diff line change @@ -1021,6 +1021,9 @@ namespace ts {
1021
1021
if ( isSourceFileJavaScript ( sourceFile ) ) {
1022
1022
if ( ! sourceFile . additionalSyntacticDiagnostics ) {
1023
1023
sourceFile . additionalSyntacticDiagnostics = getJavaScriptSyntacticDiagnosticsForFile ( sourceFile ) ;
1024
+ if ( isCheckJsEnabledForFile ( sourceFile , options ) ) {
1025
+ sourceFile . additionalSyntacticDiagnostics = concatenate ( sourceFile . additionalSyntacticDiagnostics , sourceFile . jsDocDiagnostics ) ;
1026
+ }
1024
1027
}
1025
1028
return concatenate ( sourceFile . additionalSyntacticDiagnostics , sourceFile . parseDiagnostics ) ;
1026
1029
}
Original file line number Diff line number Diff line change @@ -2312,16 +2312,19 @@ namespace ts {
2312
2312
/* @internal */ identifierCount : number ;
2313
2313
/* @internal */ symbolCount : number ;
2314
2314
2315
- // File level diagnostics reported by the parser (includes diagnostics about /// references
2315
+ // File- level diagnostics reported by the parser (includes diagnostics about /// references
2316
2316
// as well as code diagnostics).
2317
2317
/* @internal */ parseDiagnostics : Diagnostic [ ] ;
2318
2318
2319
- // Stores additional file level diagnostics reported by the program
2320
- /* @internal */ additionalSyntacticDiagnostics ?: Diagnostic [ ] ;
2321
-
2322
- // File level diagnostics reported by the binder.
2319
+ // File-level diagnostics reported by the binder.
2323
2320
/* @internal */ bindDiagnostics : Diagnostic [ ] ;
2324
2321
2322
+ // File-level JSDoc diagnostics reported by the JSDoc parser
2323
+ /* @internal */ jsDocDiagnostics ?: Diagnostic [ ] ;
2324
+
2325
+ // Stores additional file-level diagnostics reported by the program
2326
+ /* @internal */ additionalSyntacticDiagnostics ?: Diagnostic [ ] ;
2327
+
2325
2328
// Stores a line map for the file.
2326
2329
// This field should never be used directly to obtain line map, use getLineMap function instead.
2327
2330
/* @internal */ lineMap : number [ ] ;
You can’t perform that action at this time.
0 commit comments