Build script cleanup

For #277526

Quick cleanup pass after converting these scripts
This commit is contained in:
Matt Bierner
2025-11-24 14:07:28 -08:00
parent 84f778cf5a
commit e779f86b17
17 changed files with 37 additions and 49 deletions
+1 -1
View File
@@ -247,7 +247,7 @@ class MonacoGenerator {
return r;
}
private _log(message: any, ...rest: unknown[]): void {
private _log(message: string, ...rest: unknown[]): void {
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
}
+1 -1
View File
@@ -131,7 +131,7 @@ function fromLocalWebpack(extensionPath: string, webpackConfigFileName: string,
) as string[]);
const webpackStreams = webpackConfigLocations.flatMap(webpackConfigPath => {
const webpackDone = (err: any, stats: any) => {
const webpackDone = (err: Error | undefined, stats: any) => {
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
if (err) {
result.emit('error', err);
+2 -2
View File
@@ -80,7 +80,7 @@ interface BundledFormat {
type NLSKeysFormat = [string /* module ID */, string[] /* keys */];
function isNLSKeysFormat(value: any): value is NLSKeysFormat {
function isNLSKeysFormat(value: unknown): value is NLSKeysFormat {
if (value === undefined) {
return false;
}
@@ -239,7 +239,7 @@ export class XLF {
const files: { messages: Record<string, string>; name: string; language: string }[] = [];
parser.parseString(xlfString, function (err: any, result: any) {
parser.parseString(xlfString, function (err: Error | undefined, result: any) {
if (err) {
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
}
+2 -2
View File
@@ -268,7 +268,7 @@ const _nls = (() => {
// `localize` named imports
const allLocalizeImportDeclarations = importDeclarations
.filter(d => !!(d.importClause && d.importClause.namedBindings && d.importClause.namedBindings.kind === ts.SyntaxKind.NamedImports))
.map(d => ([] as any[]).concat((d.importClause!.namedBindings! as ts.NamedImports).elements))
.map(d => (d.importClause!.namedBindings! as ts.NamedImports).elements)
.flatten();
// `localize` read-only references
@@ -280,7 +280,7 @@ const _nls = (() => {
// custom named `localize` read-only references
const namedLocalizeReferences = allLocalizeImportDeclarations
.filter(d => d.propertyName && d.propertyName.getText() === functionName)
.filter(d => !!d.propertyName && d.propertyName.getText() === functionName)
.map(n => service.getReferencesAtPosition(filename, n.name.pos + 1) ?? [])
.flatten()
.filter(r => !r.isWriteAccess);
+1 -1
View File
@@ -18,7 +18,7 @@ export interface StreamTask extends BaseTask {
(): NodeJS.ReadWriteStream;
}
export interface CallbackTask extends BaseTask {
(cb?: (err?: any) => void): void;
(cb?: (err?: Error) => void): void;
}
export type Task = PromiseTask | StreamTask | CallbackTask;