mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Build script cleanup
For #277526 Quick cleanup pass after converting these scripts
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user