diff --git a/build/azure-pipelines/common/publish.ts b/build/azure-pipelines/common/publish.ts index 7ff87dbee89..e8a6776ceb1 100644 --- a/build/azure-pipelines/common/publish.ts +++ b/build/azure-pipelines/common/publish.ts @@ -315,7 +315,7 @@ function getCertificatesFromPFX(pfx: string): string[] { class ESRPReleaseService { static async create( - log: (...args: any[]) => void, + log: (...args: unknown[]) => void, tenantId: string, clientId: string, authCertificatePfx: string, @@ -350,7 +350,7 @@ class ESRPReleaseService { private static API_URL = 'https://api.esrp.microsoft.com/api/v3/releaseservices/clients/'; private constructor( - private readonly log: (...args: any[]) => void, + private readonly log: (...args: unknown[]) => void, private readonly clientId: string, private readonly accessToken: string, private readonly requestSigningCertificates: string[], @@ -848,7 +848,7 @@ async function processArtifact( artifact: Artifact, filePath: string ) { - const log = (...args: any[]) => console.log(`[${artifact.name}]`, ...args); + const log = (...args: unknown[]) => console.log(`[${artifact.name}]`, ...args); const match = /^vscode_(?[^_]+)_(?[^_]+)(?:_legacy)?_(?[^_]+)_(?[^_]+)$/.exec(artifact.name); if (!match) { diff --git a/build/azure-pipelines/distro/mixin-npm.ts b/build/azure-pipelines/distro/mixin-npm.ts index 6e32f10db50..f98f6e6b55d 100644 --- a/build/azure-pipelines/distro/mixin-npm.ts +++ b/build/azure-pipelines/distro/mixin-npm.ts @@ -7,7 +7,7 @@ import fs from 'fs'; import path from 'path'; const { dirs } = require('../../npm/dirs') as { dirs: string[] }; -function log(...args: any[]): void { +function log(...args: unknown[]): void { console.log(`[${new Date().toLocaleTimeString('en', { hour12: false })}]`, '[distro]', ...args); } diff --git a/build/azure-pipelines/distro/mixin-quality.ts b/build/azure-pipelines/distro/mixin-quality.ts index 29c90f00a65..c8ed6886b79 100644 --- a/build/azure-pipelines/distro/mixin-quality.ts +++ b/build/azure-pipelines/distro/mixin-quality.ts @@ -23,7 +23,7 @@ interface Product { readonly webBuiltInExtensions?: IBuiltInExtension[]; } -function log(...args: any[]): void { +function log(...args: unknown[]): void { console.log(`[${new Date().toLocaleTimeString('en', { hour12: false })}]`, '[distro]', ...args); } diff --git a/build/azure-pipelines/upload-nlsmetadata.ts b/build/azure-pipelines/upload-nlsmetadata.ts index 1a4f2665617..468a9341a7b 100644 --- a/build/azure-pipelines/upload-nlsmetadata.ts +++ b/build/azure-pipelines/upload-nlsmetadata.ts @@ -134,7 +134,7 @@ function main(): Promise { } })) .on('end', () => c()) - .on('error', (err: any) => e(err)); + .on('error', (err: unknown) => e(err)); }); } diff --git a/build/azure-pipelines/upload-sourcemaps.ts b/build/azure-pipelines/upload-sourcemaps.ts index 0c51827fef4..612a57c9da2 100644 --- a/build/azure-pipelines/upload-sourcemaps.ts +++ b/build/azure-pipelines/upload-sourcemaps.ts @@ -10,6 +10,7 @@ import vfs from 'vinyl-fs'; import * as util from '../lib/util'; import { getProductionDependencies } from '../lib/dependencies'; import { ClientAssertionCredential } from '@azure/identity'; +import Stream from 'stream'; const azure = require('gulp-azure-storage'); const root = path.dirname(path.dirname(__dirname)); @@ -28,7 +29,7 @@ function src(base: string, maps = `${base}/**/*.map`) { } function main(): Promise { - const sources: any[] = []; + const sources: Stream[] = []; // vscode client maps (default) if (!base) { diff --git a/build/lib/compilation.ts b/build/lib/compilation.ts index d0c54b76b7c..a8b72914925 100644 --- a/build/lib/compilation.ts +++ b/build/lib/compilation.ts @@ -249,7 +249,7 @@ class MonacoGenerator { return r; } - private _log(message: any, ...rest: any[]): void { + private _log(message: any, ...rest: unknown[]): void { fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest); } diff --git a/build/lib/i18n.ts b/build/lib/i18n.ts index 13cefe51dad..b4766f725b7 100644 --- a/build/lib/i18n.ts +++ b/build/lib/i18n.ts @@ -18,7 +18,7 @@ import { l10nJsonFormat, getL10nXlf, l10nJsonDetails, getL10nFilesFromXlf, getL1 const REPO_ROOT_PATH = path.join(__dirname, '../..'); -function log(message: any, ...rest: any[]): void { +function log(message: any, ...rest: unknown[]): void { fancyLog(ansiColors.green('[i18n]'), message, ...rest); } @@ -68,7 +68,7 @@ interface LocalizeInfo { } module LocalizeInfo { - export function is(value: any): value is LocalizeInfo { + export function is(value: unknown): value is LocalizeInfo { const candidate = value as LocalizeInfo; return candidate && typeof candidate.key === 'string' && (candidate.comment === undefined || (Array.isArray(candidate.comment) && candidate.comment.every(element => typeof element === 'string'))); } @@ -744,7 +744,7 @@ export function prepareI18nPackFiles(resultingTranslationPaths: TranslationPath[ const parsePromises: Promise[] = []; const mainPack: I18nPack = { version: i18nPackVersion, contents: {} }; const extensionsPacks: Record = {}; - const errors: any[] = []; + const errors: unknown[] = []; return through(function (this: ThroughStream, xlf: File) { let project = path.basename(path.dirname(path.dirname(xlf.relative))); // strip `-new` since vscode-extensions-loc uses the `-new` suffix to indicate that it's from the new loc pipeline diff --git a/build/lib/monaco-api.ts b/build/lib/monaco-api.ts index 86045569f38..2dfe52558aa 100644 --- a/build/lib/monaco-api.ts +++ b/build/lib/monaco-api.ts @@ -17,7 +17,7 @@ const SRC = path.join(__dirname, '../../src'); export const RECIPE_PATH = path.join(__dirname, '../monaco/monaco.d.ts.recipe'); const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts'); -function logErr(message: any, ...rest: any[]): void { +function logErr(message: any, ...rest: unknown[]): void { fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest); } diff --git a/build/lib/tsb/transpiler.ts b/build/lib/tsb/transpiler.ts index 16a3b347538..0d8d5fdf821 100644 --- a/build/lib/tsb/transpiler.ts +++ b/build/lib/tsb/transpiler.ts @@ -200,7 +200,7 @@ export class TscTranspiler implements ITranspiler { private _workerPool: TranspileWorker[] = []; private _queue: Vinyl[] = []; - private _allJobs: Promise[] = []; + private _allJobs: Promise[] = []; constructor( logFn: (topic: string, message: string) => void, diff --git a/build/lib/tsb/utils.ts b/build/lib/tsb/utils.ts index 16f93d6838f..7f0bbdd5f23 100644 --- a/build/lib/tsb/utils.ts +++ b/build/lib/tsb/utils.ts @@ -5,7 +5,7 @@ export namespace strings { - export function format(value: string, ...rest: any[]): string { + export function format(value: string, ...rest: unknown[]): string { return value.replace(/({\d+})/g, function (match) { const index = Number(match.substring(1, match.length - 1)); return String(rest[index]) || match; diff --git a/build/lib/typings/event-stream.d.ts b/build/lib/typings/event-stream.d.ts index 2b021ef258e..2b9679bfc82 100644 --- a/build/lib/typings/event-stream.d.ts +++ b/build/lib/typings/event-stream.d.ts @@ -23,5 +23,5 @@ declare module "event-stream" { function mapSync(cb: (data: I) => O): ThroughStream; function map(cb: (data: I, cb: (err?: Error, data?: O) => void) => O): ThroughStream; - function readable(asyncFunction: (this: ThroughStream, ...args: any[]) => any): any; -} \ No newline at end of file + function readable(asyncFunction: (this: ThroughStream, ...args: unknown[]) => any): any; +}