Skip to content

Commit

Permalink
build: add diagnose return type annotation for windows bazel builds
Browse files Browse the repository at this point in the history
Due to the Windows Bazel directory structure, TypeScript can not safely
infer the return type of the `diagnose` function in the parallel worker
module. The return type should ideally be explicit regardless and so
a return type is now provided for the function.

(cherry picked from commit 9e91463)
  • Loading branch information
clydin committed Oct 18, 2023
1 parent cb9bbca commit 46b8dda
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import type { PartialMessage } from 'esbuild';
import assert from 'node:assert';
import { randomUUID } from 'node:crypto';
import { type MessagePort, receiveMessageOnPort } from 'node:worker_threads';
Expand Down Expand Up @@ -98,7 +99,10 @@ export async function initialize(request: InitRequest) {
};
}

export async function diagnose() {
export async function diagnose(): Promise<{
errors?: PartialMessage[];
warnings?: PartialMessage[];
}> {
assert(compilation);

const diagnostics = await compilation.diagnoseFiles();
Expand Down

0 comments on commit 46b8dda

Please sign in to comment.