diff --git a/build/azure-pipelines/common/publish.js b/build/azure-pipelines/common/publish.js index 2199846a7c1..f93cbfe1c37 100644 --- a/build/azure-pipelines/common/publish.js +++ b/build/azure-pipelines/common/publish.js @@ -264,6 +264,7 @@ class ESRPReleaseService { // Release service uses hex format, not base64url :roll_eyes: x5t: getThumbprint(this.requestSigningCertificates[0], 'sha1').toString('hex'), // Release service uses a '.' separated string, not an array of strings :roll_eyes: + // eslint-disable-next-line local/code-no-any-casts x5c: this.requestSigningCertificates.map(c => getCertificateBuffer(c).toString('base64url')).join('.'), }, payload: message, diff --git a/build/azure-pipelines/upload-cdn.js b/build/azure-pipelines/upload-cdn.js index fcf24ad6073..b19e78001d8 100644 --- a/build/azure-pipelines/upload-cdn.js +++ b/build/azure-pipelines/upload-cdn.js @@ -105,6 +105,7 @@ async function main() { const listing = new vinyl_1.default({ path: 'files.txt', contents: Buffer.from(files.join('\n')), + // eslint-disable-next-line local/code-no-any-casts stat: { mode: 0o666 } }); const filesOut = event_stream_1.default.readArray([listing]) diff --git a/build/lib/compilation.js b/build/lib/compilation.js index fb326dfd2b1..fe4408136bb 100644 --- a/build/lib/compilation.js +++ b/build/lib/compilation.js @@ -160,6 +160,7 @@ function compileTask(src, out, build, options = {}) { // free resources (await newContentsByFileName).clear(); this.push(null); + // eslint-disable-next-line local/code-no-any-casts ts2tsMangler = undefined; }); } diff --git a/build/lib/extensions.js b/build/lib/extensions.js index c80a1be1a84..108bc84b487 100644 --- a/build/lib/extensions.js +++ b/build/lib/extensions.js @@ -151,6 +151,7 @@ function fromLocalWebpack(extensionPath, webpackConfigFileName, disableMangle) { path: filePath, stat: fs_1.default.statSync(filePath), base: extensionPath, + // eslint-disable-next-line local/code-no-any-casts contents: fs_1.default.createReadStream(filePath) })); // check for a webpack configuration files, then invoke webpack @@ -235,6 +236,7 @@ function fromLocalNormal(extensionPath) { path: filePath, stat: fs_1.default.statSync(filePath), base: extensionPath, + // eslint-disable-next-line local/code-no-any-casts contents: fs_1.default.createReadStream(filePath) })); event_stream_1.default.readArray(files).pipe(result); diff --git a/build/lib/fetch.js b/build/lib/fetch.js index 25587697016..398860ac746 100644 --- a/build/lib/fetch.js +++ b/build/lib/fetch.js @@ -48,6 +48,7 @@ async function fetchUrl(url, options, retries = 10, retryDelay = 1000) { try { const response = await fetch(url, { ...options.nodeFetchOptions, + // eslint-disable-next-line local/code-no-any-casts signal: controller.signal /* Typings issue with lib.dom.d.ts */ }); if (verbose) { diff --git a/build/lib/mangle/index.js b/build/lib/mangle/index.js index 40a9f7bbe66..c8daa84ae51 100644 --- a/build/lib/mangle/index.js +++ b/build/lib/mangle/index.js @@ -242,6 +242,7 @@ class ClassData { } } function isNameTakenInFile(node, name) { + // eslint-disable-next-line local/code-no-any-casts const identifiers = node.getSourceFile().identifiers; if (identifiers instanceof Map) { if (identifiers.has(name)) { diff --git a/build/lib/monaco-api.js b/build/lib/monaco-api.js index cc801849a5d..265addfd098 100644 --- a/build/lib/monaco-api.js +++ b/build/lib/monaco-api.js @@ -187,6 +187,7 @@ function format(ts, text, endl) { // Parse the source text const sourceFile = ts.createSourceFile('file.ts', text, ts.ScriptTarget.Latest, /*setParentPointers*/ true); // Get the formatting edits on the input sources + // eslint-disable-next-line local/code-no-any-casts const edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(tsfmt), tsfmt); // Apply the edits on the input code return applyEdits(text, edits); @@ -284,6 +285,7 @@ function format(ts, text, endl) { function getRuleProvider(options) { // Share this between multiple formatters using the same options. // This represents the bulk of the space the formatter uses. + // eslint-disable-next-line local/code-no-any-casts return ts.formatting.getFormatContext(options); } function applyEdits(text, edits) { diff --git a/build/lib/nls.js b/build/lib/nls.js index 492dbdae8ce..adb40668fe4 100644 --- a/build/lib/nls.js +++ b/build/lib/nls.js @@ -32,6 +32,7 @@ function collect(ts, node, fn) { return result; } function clone(object) { + // eslint-disable-next-line local/code-no-any-casts const result = {}; for (const id in object) { result[id] = object[id]; @@ -389,8 +390,11 @@ var _nls; const moduleId = javascriptFile.relative .replace(/\.js$/, '') .replace(/\\/g, '/'); - const { javascript, sourcemap, nlsKeys, nlsMessages } = patch(ts, typescript, javascriptFile.contents.toString(), javascriptFile.sourceMap, options); + const { javascript, sourcemap, nlsKeys, nlsMessages } = patch(ts, typescript, javascriptFile.contents.toString(), + // eslint-disable-next-line local/code-no-any-casts + javascriptFile.sourceMap, options); const result = fileFrom(javascriptFile, javascript); + // eslint-disable-next-line local/code-no-any-casts result.sourceMap = sourcemap; if (nlsKeys) { _nls.moduleToNLSKeys[moduleId] = nlsKeys; diff --git a/build/lib/optimize.js b/build/lib/optimize.js index fbc455b1cd1..f52140e0784 100644 --- a/build/lib/optimize.js +++ b/build/lib/optimize.js @@ -213,7 +213,9 @@ function minifyTask(src, sourceMapBaseUrl) { cb(undefined, f); } }, cb); - }), esbuildFilter.restore, svgFilter, svgmin(), svgFilter.restore, gulp_sourcemaps_1.default.write('./', { + }), esbuildFilter.restore, svgFilter, svgmin(), svgFilter.restore, + // eslint-disable-next-line local/code-no-any-casts + gulp_sourcemaps_1.default.write('./', { sourceMappingURL, sourceRoot: undefined, includeContent: true, diff --git a/build/lib/propertyInitOrderChecker.js b/build/lib/propertyInitOrderChecker.js index 48134856308..a1da1835bd9 100644 --- a/build/lib/propertyInitOrderChecker.js +++ b/build/lib/propertyInitOrderChecker.js @@ -233,8 +233,11 @@ function* findAllReferencesInClass(node) { function findAllReferences(node) { const sourceFile = node.getSourceFile(); const position = node.getStart(); + // eslint-disable-next-line local/code-no-any-casts const name = ts.getTouchingPropertyName(sourceFile, position); + // eslint-disable-next-line local/code-no-any-casts const options = { use: ts.FindAllReferences.FindReferencesUse.References }; + // eslint-disable-next-line local/code-no-any-casts return ts.FindAllReferences.Core.getReferencedSymbolsForNode(position, name, program, [sourceFile], cancellationToken, options) ?? []; } var DefinitionKind; diff --git a/build/lib/reporter.js b/build/lib/reporter.js index da3ca0f46a1..e8570ef6d5a 100644 --- a/build/lib/reporter.js +++ b/build/lib/reporter.js @@ -87,11 +87,14 @@ function createReporter(id) { return event_stream_1.default.through(undefined, function () { errorLog.onEnd(); if (emitError && errors.length > 0) { + // eslint-disable-next-line local/code-no-any-casts if (!errors.__logged__) { errorLog.log(); } + // eslint-disable-next-line local/code-no-any-casts errors.__logged__ = true; const err = new Error(`Found ${errors.length} errors`); + // eslint-disable-next-line local/code-no-any-casts err.__reporter__ = true; this.emit('error', err); } diff --git a/build/lib/task.js b/build/lib/task.js index 025e0a4e8f2..9a149ec7f0c 100644 --- a/build/lib/task.js +++ b/build/lib/task.js @@ -13,6 +13,7 @@ exports.define = define; const fancy_log_1 = __importDefault(require("fancy-log")); const ansi_colors_1 = __importDefault(require("ansi-colors")); function _isPromise(p) { + // eslint-disable-next-line local/code-no-any-casts if (typeof p.then === 'function') { return true; } diff --git a/build/lib/treeshaking.js b/build/lib/treeshaking.js index a42fbf961ab..5b339091e07 100644 --- a/build/lib/treeshaking.js +++ b/build/lib/treeshaking.js @@ -230,15 +230,19 @@ var NodeColor; NodeColor[NodeColor["Black"] = 2] = "Black"; })(NodeColor || (NodeColor = {})); function getColor(node) { + // eslint-disable-next-line local/code-no-any-casts return node.$$$color || 0 /* NodeColor.White */; } function setColor(node, color) { + // eslint-disable-next-line local/code-no-any-casts node.$$$color = color; } function markNeededSourceFile(node) { + // eslint-disable-next-line local/code-no-any-casts node.$$$neededSourceFile = true; } function isNeededSourceFile(node) { + // eslint-disable-next-line local/code-no-any-casts return Boolean(node.$$$neededSourceFile); } function nodeOrParentIsBlack(node) { @@ -561,6 +565,7 @@ function markNodes(ts, languageService, options) { if (nodeOrParentIsBlack(node)) { continue; } + // eslint-disable-next-line local/code-no-any-casts const symbol = node.symbol; if (!symbol) { continue; @@ -768,8 +773,11 @@ class SymbolImportTuple { * Returns the node's symbol and the `import` node (if the symbol resolved from a different module) */ function getRealNodeSymbol(ts, checker, node) { + // eslint-disable-next-line local/code-no-any-casts const getPropertySymbolsFromContextualType = ts.getPropertySymbolsFromContextualType; + // eslint-disable-next-line local/code-no-any-casts const getContainingObjectLiteralElement = ts.getContainingObjectLiteralElement; + // eslint-disable-next-line local/code-no-any-casts const getNameFromPropertyName = ts.getNameFromPropertyName; // Go to the original declaration for cases: // diff --git a/build/lib/tsb/builder.js b/build/lib/tsb/builder.js index f4f60cf8521..47e23763965 100644 --- a/build/lib/tsb/builder.js +++ b/build/lib/tsb/builder.js @@ -75,6 +75,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) { host.getCompilationSettings().declaration = true; function file(file) { // support gulp-sourcemaps + // eslint-disable-next-line local/code-no-any-casts if (file.sourceMap) { emitSourceMapsInStream = false; } @@ -95,6 +96,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) { } } function isExternalModule(sourceFile) { + // eslint-disable-next-line local/code-no-any-casts return sourceFile.externalModuleIndicator || /declare\s+module\s+('|")(.+)\1/.test(sourceFile.getText()); } @@ -219,6 +221,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) { if (didChange) { [tsSMC, inputSMC].forEach((consumer) => { consumer.sources.forEach((sourceFile) => { + // eslint-disable-next-line local/code-no-any-casts smg._sources.add(sourceFile); const sourceContent = consumer.sourceContentFor(sourceFile); if (sourceContent !== null) { @@ -234,6 +237,7 @@ function createTypeScriptBuilder(config, projectFile, cmd) { // }); } } + // eslint-disable-next-line local/code-no-any-casts vinyl.sourceMap = sourceMap; } } @@ -517,6 +521,7 @@ class LanguageServiceHost { let result = this._snapshots[filename]; if (!result && resolve) { try { + // eslint-disable-next-line local/code-no-any-casts result = new VinylScriptSnapshot(new vinyl_1.default({ path: filename, contents: fs_1.default.readFileSync(filename), diff --git a/build/lib/tsb/index.js b/build/lib/tsb/index.js index af10bf8ce19..67c82c8bb9e 100644 --- a/build/lib/tsb/index.js +++ b/build/lib/tsb/index.js @@ -134,10 +134,12 @@ function create(projectPath, existingOptions, config, onError = _defaultOnError) const transpiler = !config.transpileWithEsbuild ? new transpiler_1.TscTranspiler(logFn, printDiagnostic, projectPath, cmdLine) : new transpiler_1.ESBuildTranspiler(logFn, printDiagnostic, projectPath, cmdLine); + // eslint-disable-next-line local/code-no-any-casts result = (() => createTranspileStream(transpiler)); } else { const _builder = builder.createTypeScriptBuilder({ logFn }, projectPath, cmdLine); + // eslint-disable-next-line local/code-no-any-casts result = ((token) => createCompileStream(_builder, token)); } result.src = (opts) => { diff --git a/build/lib/util.js b/build/lib/util.js index 389b9e0cd4f..e1c162040dc 100644 --- a/build/lib/util.js +++ b/build/lib/util.js @@ -116,6 +116,7 @@ function fixWin32DirectoryPermissions() { function setExecutableBit(pattern) { const setBit = event_stream_1.default.mapSync(f => { if (!f.stat) { + // eslint-disable-next-line local/code-no-any-casts f.stat = { isFile() { return true; } }; } f.stat.mode = /* 100755 */ 33261; @@ -288,6 +289,7 @@ function rebase(count) { }); } function filter(fn) { + // eslint-disable-next-line local/code-no-any-casts const result = event_stream_1.default.through(function (data) { if (fn(data)) { this.emit('data', data); diff --git a/build/lib/watch/watch-win32.js b/build/lib/watch/watch-win32.js index 4113d93526e..1355055e768 100644 --- a/build/lib/watch/watch-win32.js +++ b/build/lib/watch/watch-win32.js @@ -42,6 +42,7 @@ function watch(root) { path: changePathFull, base: root }); + // eslint-disable-next-line local/code-no-any-casts file.event = toChangeType(changeType); result.emit('data', file); } diff --git a/build/linux/debian/install-sysroot.js b/build/linux/debian/install-sysroot.js index d16e13bd63e..8ad94877788 100644 --- a/build/linux/debian/install-sysroot.js +++ b/build/linux/debian/install-sysroot.js @@ -73,6 +73,7 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) { try { const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, { headers: ghApiHeaders, + // eslint-disable-next-line local/code-no-any-casts signal: controller.signal /* Typings issue with lib.dom.d.ts */ }); if (response.ok && (response.status >= 200 && response.status < 300)) { diff --git a/build/win32/explorer-dll-fetcher.js b/build/win32/explorer-dll-fetcher.js index dfb9ce97ff4..f7d7c49700d 100644 --- a/build/win32/explorer-dll-fetcher.js +++ b/build/win32/explorer-dll-fetcher.js @@ -53,6 +53,7 @@ async function main(outputDir) { if (!outputDir) { throw new Error('Required build env not set'); } + // eslint-disable-next-line local/code-no-any-casts await downloadExplorerDll(outputDir, product_json_1.default.quality, arch); } if (require.main === module) {