diff options
Diffstat (limited to 'cli')
60 files changed, 265 insertions, 256 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 896b5c800..d8bc8d0fd 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -40,7 +40,7 @@ declare interface Performance { declare interface PerformanceMarkOptions { /** Metadata to be included in the mark. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any detail?: any; /** Timestamp to be used as the mark time. */ @@ -49,7 +49,7 @@ declare interface PerformanceMarkOptions { declare interface PerformanceMeasureOptions { /** Metadata to be included in the measure. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any detail?: any; /** Timestamp to be used as the start time or string to be used as start @@ -1847,7 +1847,7 @@ declare namespace Deno { export function metrics(): Metrics; interface ResourceMap { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any [rid: number]: any; } diff --git a/cli/dts/lib.deno.shared_globals.d.ts b/cli/dts/lib.deno.shared_globals.d.ts index 03b85f50d..6eb9019ad 100644 --- a/cli/dts/lib.deno.shared_globals.d.ts +++ b/cli/dts/lib.deno.shared_globals.d.ts @@ -3,8 +3,6 @@ // Documentation partially adapted from [MDN](https://developer.mozilla.org/), // by Mozilla Contributors, which is licensed under CC-BY-SA 2.5. -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, no-var */ - /// <reference no-default-lib="true" /> /// <reference lib="esnext" /> /// <reference lib="deno.web" /> diff --git a/cli/dts/lib.deno.window.d.ts b/cli/dts/lib.deno.window.d.ts index 541eee370..996f73b86 100644 --- a/cli/dts/lib.deno.window.d.ts +++ b/cli/dts/lib.deno.window.d.ts @@ -1,7 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -/* eslint-disable @typescript-eslint/no-explicit-any */ - /// <reference no-default-lib="true" /> /// <reference lib="deno.ns" /> /// <reference lib="deno.shared_globals" /> @@ -51,5 +49,3 @@ declare function confirm(message?: string): boolean; * @param defaultValue */ declare function prompt(message?: string, defaultValue?: string): string | null; - -/* eslint-enable @typescript-eslint/no-explicit-any */ diff --git a/cli/dts/lib.deno.worker.d.ts b/cli/dts/lib.deno.worker.d.ts index a10b1a276..1d570680f 100644 --- a/cli/dts/lib.deno.worker.d.ts +++ b/cli/dts/lib.deno.worker.d.ts @@ -1,7 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */ - /// <reference no-default-lib="true" /> /// <reference lib="deno.ns" /> /// <reference lib="deno.shared_globals" /> @@ -60,5 +58,3 @@ declare var onerror: declare var close: () => void; declare var name: string; declare var postMessage: (message: any) => void; - -/* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */ diff --git a/cli/rt/02_console.js b/cli/rt/02_console.js index bb2b6ea41..971837bd6 100644 --- a/cli/rt/02_console.js +++ b/cli/rt/02_console.js @@ -173,8 +173,6 @@ static kClearScreenDown = "\x1b[0J"; } - /* eslint-disable @typescript-eslint/no-use-before-define */ - function getClassInstanceName(instance) { if (typeof instance != "object") { return ""; @@ -194,7 +192,9 @@ if (customInspect in value && typeof value[customInspect] === "function") { try { return String(value[customInspect]()); - } catch {} + } catch { + // pass + } } // Might be Function/AsyncFunction/GeneratorFunction/AsyncGeneratorFunction let cstrName = Object.getPrototypeOf(value)?.constructor?.name; @@ -358,7 +358,6 @@ let order = "padStart"; if (value !== undefined) { for (let i = 0; i < entries.length; i++) { - /* eslint-disable @typescript-eslint/no-explicit-any */ if ( typeof value[i] !== "number" && typeof value[i] !== "bigint" @@ -366,7 +365,6 @@ order = "padEnd"; break; } - /* eslint-enable */ } } // Each iteration creates a single line of grouped entries. @@ -483,6 +481,7 @@ .replace(/\t/g, "\\t") .replace(/\v/g, "\\v") .replace( + // deno-lint-ignore no-control-regex /[\x00-\x1f\x7f-\x9f]/g, (c) => "\\x" + c.charCodeAt(0).toString(16).padStart(2, "0"), ); @@ -519,11 +518,12 @@ ) { const green = maybeColor(colors.green, inspectOptions); switch (typeof value) { - case "string": + case "string": { const trunc = value.length > STR_ABBREVIATE_SIZE ? value.slice(0, STR_ABBREVIATE_SIZE) + "..." : value; return green(quoteString(trunc)); // Quoted strings are green + } default: return inspectValue(value, ctx, level, inspectOptions); } @@ -784,7 +784,7 @@ : red(`[Thrown ${error.name}: ${error.message}]`); entries.push(`${maybeQuoteString(key)}: ${inspectedValue}`); } else { - let descriptor = Object.getOwnPropertyDescriptor(value, key); + const descriptor = Object.getOwnPropertyDescriptor(value, key); if (descriptor.get !== undefined && descriptor.set !== undefined) { entries.push(`${maybeQuoteString(key)}: [Getter/Setter]`); } else if (descriptor.get !== undefined) { @@ -818,7 +818,7 @@ : red(`Thrown ${error.name}: ${error.message}`); entries.push(`[${maybeQuoteSymbol(key)}]: ${inspectedValue}`); } else { - let descriptor = Object.getOwnPropertyDescriptor(value, key); + const descriptor = Object.getOwnPropertyDescriptor(value, key); if (descriptor.get !== undefined && descriptor.set !== undefined) { entries.push(`[${maybeQuoteSymbol(key)}]: [Getter/Setter]`); } else if (descriptor.get !== undefined) { @@ -867,7 +867,9 @@ if (customInspect in value && typeof value[customInspect] === "function") { try { return String(value[customInspect]()); - } catch {} + } catch { + // pass + } } // This non-unique symbol is used to support op_crates, ie. // in op_crates/web we don't want to depend on unique "Deno.customInspect" @@ -880,7 +882,9 @@ ) { try { return String(value[nonUniqueCustomInspect]()); - } catch {} + } catch { + // pass + } } if (value instanceof Error) { return String(value.stack); @@ -1158,7 +1162,7 @@ let inValue = false; let currentKey = null; let parenthesesDepth = 0; - currentPart = ""; + let currentPart = ""; for (let i = 0; i < cssString.length; i++) { const c = cssString[i]; if (c == "(") { diff --git a/cli/rt/11_workers.js b/cli/rt/11_workers.js index dcf98aee6..36a2fd61b 100644 --- a/cli/rt/11_workers.js +++ b/cli/rt/11_workers.js @@ -1,5 +1,4 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -/* eslint-disable @typescript-eslint/no-explicit-any */ ((window) => { const core = window.Deno.core; diff --git a/cli/rt/40_compiler_api.js b/cli/rt/40_compiler_api.js index db12c857d..ea963b67b 100644 --- a/cli/rt/40_compiler_api.js +++ b/cli/rt/40_compiler_api.js @@ -81,7 +81,7 @@ }); /** @type {{ emittedFiles: Record<string, string>, diagnostics: any[] }} */ const result = await opCompile(payload); - let output = result.emittedFiles["deno:///bundle.js"]; + const output = result.emittedFiles["deno:///bundle.js"]; util.assert(output); const maybeDiagnostics = result.diagnostics.length === 0 ? undefined diff --git a/cli/rt/40_write_file.js b/cli/rt/40_write_file.js index 2f54aa1cf..7a9cb1f40 100644 --- a/cli/rt/40_write_file.js +++ b/cli/rt/40_write_file.js @@ -18,7 +18,7 @@ } } - const openOptions = !!options.append + const openOptions = options.append ? { write: true, create: true, append: true } : { write: true, create: true, truncate: true }; const file = openSync(path, openOptions); @@ -48,7 +48,7 @@ } } - const openOptions = !!options.append + const openOptions = options.append ? { write: true, create: true, append: true } : { write: true, create: true, truncate: true }; const file = await open(path, openOptions); diff --git a/cli/rt/90_deno_ns.js b/cli/rt/90_deno_ns.js index 6a9b9cc0e..9188788ec 100644 --- a/cli/rt/90_deno_ns.js +++ b/cli/rt/90_deno_ns.js @@ -1,134 +1,137 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -__bootstrap.denoNs = { - test: __bootstrap.testing.test, - metrics: __bootstrap.metrics.metrics, - Process: __bootstrap.process.Process, - run: __bootstrap.process.run, - isatty: __bootstrap.tty.isatty, - writeFileSync: __bootstrap.writeFile.writeFileSync, - writeFile: __bootstrap.writeFile.writeFile, - writeTextFileSync: __bootstrap.writeFile.writeTextFileSync, - writeTextFile: __bootstrap.writeFile.writeTextFile, - readTextFile: __bootstrap.readFile.readTextFile, - readTextFileSync: __bootstrap.readFile.readTextFileSync, - readFile: __bootstrap.readFile.readFile, - readFileSync: __bootstrap.readFile.readFileSync, - watchFs: __bootstrap.fsEvents.watchFs, - chmodSync: __bootstrap.fs.chmodSync, - chmod: __bootstrap.fs.chmod, - chown: __bootstrap.fs.chown, - chownSync: __bootstrap.fs.chownSync, - copyFileSync: __bootstrap.fs.copyFileSync, - cwd: __bootstrap.fs.cwd, - makeTempDirSync: __bootstrap.fs.makeTempDirSync, - makeTempDir: __bootstrap.fs.makeTempDir, - makeTempFileSync: __bootstrap.fs.makeTempFileSync, - makeTempFile: __bootstrap.fs.makeTempFile, - mkdirSync: __bootstrap.fs.mkdirSync, - mkdir: __bootstrap.fs.mkdir, - chdir: __bootstrap.fs.chdir, - copyFile: __bootstrap.fs.copyFile, - readDirSync: __bootstrap.fs.readDirSync, - readDir: __bootstrap.fs.readDir, - readLinkSync: __bootstrap.fs.readLinkSync, - readLink: __bootstrap.fs.readLink, - realPathSync: __bootstrap.fs.realPathSync, - realPath: __bootstrap.fs.realPath, - removeSync: __bootstrap.fs.removeSync, - remove: __bootstrap.fs.remove, - renameSync: __bootstrap.fs.renameSync, - rename: __bootstrap.fs.rename, - version: __bootstrap.version.version, - build: __bootstrap.build.build, - statSync: __bootstrap.fs.statSync, - lstatSync: __bootstrap.fs.lstatSync, - stat: __bootstrap.fs.stat, - lstat: __bootstrap.fs.lstat, - truncateSync: __bootstrap.fs.truncateSync, - truncate: __bootstrap.fs.truncate, - errors: __bootstrap.errors.errors, - customInspect: __bootstrap.console.customInspect, - inspect: __bootstrap.console.inspect, - env: __bootstrap.os.env, - exit: __bootstrap.os.exit, - execPath: __bootstrap.os.execPath, - Buffer: __bootstrap.buffer.Buffer, - readAll: __bootstrap.buffer.readAll, - readAllSync: __bootstrap.buffer.readAllSync, - writeAll: __bootstrap.buffer.writeAll, - writeAllSync: __bootstrap.buffer.writeAllSync, - copy: __bootstrap.io.copy, - iter: __bootstrap.io.iter, - iterSync: __bootstrap.io.iterSync, - SeekMode: __bootstrap.io.SeekMode, - read: __bootstrap.io.read, - readSync: __bootstrap.io.readSync, - write: __bootstrap.io.write, - writeSync: __bootstrap.io.writeSync, - File: __bootstrap.files.File, - open: __bootstrap.files.open, - openSync: __bootstrap.files.openSync, - create: __bootstrap.files.create, - createSync: __bootstrap.files.createSync, - stdin: __bootstrap.files.stdin, - stdout: __bootstrap.files.stdout, - stderr: __bootstrap.files.stderr, - seek: __bootstrap.files.seek, - seekSync: __bootstrap.files.seekSync, - connect: __bootstrap.net.connect, - listen: __bootstrap.net.listen, - connectTls: __bootstrap.tls.connectTls, - listenTls: __bootstrap.tls.listenTls, - sleepSync: __bootstrap.timers.sleepSync, - fsyncSync: __bootstrap.fs.fsyncSync, - fsync: __bootstrap.fs.fsync, - fdatasyncSync: __bootstrap.fs.fdatasyncSync, - fdatasync: __bootstrap.fs.fdatasync, -}; +((window) => { + const __bootstrap = window.__bootstrap; + __bootstrap.denoNs = { + test: __bootstrap.testing.test, + metrics: __bootstrap.metrics.metrics, + Process: __bootstrap.process.Process, + run: __bootstrap.process.run, + isatty: __bootstrap.tty.isatty, + writeFileSync: __bootstrap.writeFile.writeFileSync, + writeFile: __bootstrap.writeFile.writeFile, + writeTextFileSync: __bootstrap.writeFile.writeTextFileSync, + writeTextFile: __bootstrap.writeFile.writeTextFile, + readTextFile: __bootstrap.readFile.readTextFile, + readTextFileSync: __bootstrap.readFile.readTextFileSync, + readFile: __bootstrap.readFile.readFile, + readFileSync: __bootstrap.readFile.readFileSync, + watchFs: __bootstrap.fsEvents.watchFs, + chmodSync: __bootstrap.fs.chmodSync, + chmod: __bootstrap.fs.chmod, + chown: __bootstrap.fs.chown, + chownSync: __bootstrap.fs.chownSync, + copyFileSync: __bootstrap.fs.copyFileSync, + cwd: __bootstrap.fs.cwd, + makeTempDirSync: __bootstrap.fs.makeTempDirSync, + makeTempDir: __bootstrap.fs.makeTempDir, + makeTempFileSync: __bootstrap.fs.makeTempFileSync, + makeTempFile: __bootstrap.fs.makeTempFile, + mkdirSync: __bootstrap.fs.mkdirSync, + mkdir: __bootstrap.fs.mkdir, + chdir: __bootstrap.fs.chdir, + copyFile: __bootstrap.fs.copyFile, + readDirSync: __bootstrap.fs.readDirSync, + readDir: __bootstrap.fs.readDir, + readLinkSync: __bootstrap.fs.readLinkSync, + readLink: __bootstrap.fs.readLink, + realPathSync: __bootstrap.fs.realPathSync, + realPath: __bootstrap.fs.realPath, + removeSync: __bootstrap.fs.removeSync, + remove: __bootstrap.fs.remove, + renameSync: __bootstrap.fs.renameSync, + rename: __bootstrap.fs.rename, + version: __bootstrap.version.version, + build: __bootstrap.build.build, + statSync: __bootstrap.fs.statSync, + lstatSync: __bootstrap.fs.lstatSync, + stat: __bootstrap.fs.stat, + lstat: __bootstrap.fs.lstat, + truncateSync: __bootstrap.fs.truncateSync, + truncate: __bootstrap.fs.truncate, + errors: __bootstrap.errors.errors, + customInspect: __bootstrap.console.customInspect, + inspect: __bootstrap.console.inspect, + env: __bootstrap.os.env, + exit: __bootstrap.os.exit, + execPath: __bootstrap.os.execPath, + Buffer: __bootstrap.buffer.Buffer, + readAll: __bootstrap.buffer.readAll, + readAllSync: __bootstrap.buffer.readAllSync, + writeAll: __bootstrap.buffer.writeAll, + writeAllSync: __bootstrap.buffer.writeAllSync, + copy: __bootstrap.io.copy, + iter: __bootstrap.io.iter, + iterSync: __bootstrap.io.iterSync, + SeekMode: __bootstrap.io.SeekMode, + read: __bootstrap.io.read, + readSync: __bootstrap.io.readSync, + write: __bootstrap.io.write, + writeSync: __bootstrap.io.writeSync, + File: __bootstrap.files.File, + open: __bootstrap.files.open, + openSync: __bootstrap.files.openSync, + create: __bootstrap.files.create, + createSync: __bootstrap.files.createSync, + stdin: __bootstrap.files.stdin, + stdout: __bootstrap.files.stdout, + stderr: __bootstrap.files.stderr, + seek: __bootstrap.files.seek, + seekSync: __bootstrap.files.seekSync, + connect: __bootstrap.net.connect, + listen: __bootstrap.net.listen, + connectTls: __bootstrap.tls.connectTls, + listenTls: __bootstrap.tls.listenTls, + sleepSync: __bootstrap.timers.sleepSync, + fsyncSync: __bootstrap.fs.fsyncSync, + fsync: __bootstrap.fs.fsync, + fdatasyncSync: __bootstrap.fs.fdatasyncSync, + fdatasync: __bootstrap.fs.fdatasync, + }; -__bootstrap.denoNsUnstable = { - signal: __bootstrap.signals.signal, - signals: __bootstrap.signals.signals, - Signal: __bootstrap.signals.Signal, - SignalStream: __bootstrap.signals.SignalStream, - transpileOnly: __bootstrap.compilerApi.transpileOnly, - compile: __bootstrap.compilerApi.compile, - bundle: __bootstrap.compilerApi.bundle, - permissions: __bootstrap.permissions.permissions, - Permissions: __bootstrap.permissions.Permissions, - PermissionStatus: __bootstrap.permissions.PermissionStatus, - openPlugin: __bootstrap.plugins.openPlugin, - kill: __bootstrap.process.kill, - setRaw: __bootstrap.tty.setRaw, - consoleSize: __bootstrap.tty.consoleSize, - DiagnosticCategory: __bootstrap.diagnostics.DiagnosticCategory, - loadavg: __bootstrap.os.loadavg, - hostname: __bootstrap.os.hostname, - osRelease: __bootstrap.os.osRelease, - systemMemoryInfo: __bootstrap.os.systemMemoryInfo, - systemCpuInfo: __bootstrap.os.systemCpuInfo, - applySourceMap: __bootstrap.errorStack.opApplySourceMap, - formatDiagnostics: __bootstrap.errorStack.opFormatDiagnostics, - shutdown: __bootstrap.net.shutdown, - ShutdownMode: __bootstrap.net.ShutdownMode, - listen: __bootstrap.netUnstable.listen, - connect: __bootstrap.netUnstable.connect, - listenDatagram: __bootstrap.netUnstable.listenDatagram, - startTls: __bootstrap.tls.startTls, - fstatSync: __bootstrap.fs.fstatSync, - fstat: __bootstrap.fs.fstat, - ftruncateSync: __bootstrap.fs.ftruncateSync, - ftruncate: __bootstrap.fs.ftruncate, - umask: __bootstrap.fs.umask, - link: __bootstrap.fs.link, - linkSync: __bootstrap.fs.linkSync, - futime: __bootstrap.fs.futime, - futimeSync: __bootstrap.fs.futimeSync, - utime: __bootstrap.fs.utime, - utimeSync: __bootstrap.fs.utimeSync, - symlink: __bootstrap.fs.symlink, - symlinkSync: __bootstrap.fs.symlinkSync, - HttpClient: __bootstrap.fetch.HttpClient, - createHttpClient: __bootstrap.fetch.createHttpClient, -}; + __bootstrap.denoNsUnstable = { + signal: __bootstrap.signals.signal, + signals: __bootstrap.signals.signals, + Signal: __bootstrap.signals.Signal, + SignalStream: __bootstrap.signals.SignalStream, + transpileOnly: __bootstrap.compilerApi.transpileOnly, + compile: __bootstrap.compilerApi.compile, + bundle: __bootstrap.compilerApi.bundle, + permissions: __bootstrap.permissions.permissions, + Permissions: __bootstrap.permissions.Permissions, + PermissionStatus: __bootstrap.permissions.PermissionStatus, + openPlugin: __bootstrap.plugins.openPlugin, + kill: __bootstrap.process.kill, + setRaw: __bootstrap.tty.setRaw, + consoleSize: __bootstrap.tty.consoleSize, + DiagnosticCategory: __bootstrap.diagnostics.DiagnosticCategory, + loadavg: __bootstrap.os.loadavg, + hostname: __bootstrap.os.hostname, + osRelease: __bootstrap.os.osRelease, + systemMemoryInfo: __bootstrap.os.systemMemoryInfo, + systemCpuInfo: __bootstrap.os.systemCpuInfo, + applySourceMap: __bootstrap.errorStack.opApplySourceMap, + formatDiagnostics: __bootstrap.errorStack.opFormatDiagnostics, + shutdown: __bootstrap.net.shutdown, + ShutdownMode: __bootstrap.net.ShutdownMode, + listen: __bootstrap.netUnstable.listen, + connect: __bootstrap.netUnstable.connect, + listenDatagram: __bootstrap.netUnstable.listenDatagram, + startTls: __bootstrap.tls.startTls, + fstatSync: __bootstrap.fs.fstatSync, + fstat: __bootstrap.fs.fstat, + ftruncateSync: __bootstrap.fs.ftruncateSync, + ftruncate: __bootstrap.fs.ftruncate, + umask: __bootstrap.fs.umask, + link: __bootstrap.fs.link, + linkSync: __bootstrap.fs.linkSync, + futime: __bootstrap.fs.futime, + futimeSync: __bootstrap.fs.futimeSync, + utime: __bootstrap.fs.utime, + utimeSync: __bootstrap.fs.utimeSync, + symlink: __bootstrap.fs.symlink, + symlinkSync: __bootstrap.fs.symlinkSync, + HttpClient: __bootstrap.fetch.HttpClient, + createHttpClient: __bootstrap.fetch.createHttpClient, + }; +})(this); diff --git a/cli/system_loader.js b/cli/system_loader.js index 8c083fccc..bb25bb2dd 100644 --- a/cli/system_loader.js +++ b/cli/system_loader.js @@ -1,11 +1,12 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file + // This is a specialised implementation of a System module loader. "use strict"; // @ts-nocheck -/* eslint-disable */ let System, __instantiate; (() => { const r = new Map(); diff --git a/cli/system_loader_es5.js b/cli/system_loader_es5.js index 0970e8305..daf941d76 100644 --- a/cli/system_loader_es5.js +++ b/cli/system_loader_es5.js @@ -1,11 +1,12 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file + // This is a specialised implementation of a System module loader. "use strict"; // @ts-nocheck -/* eslint-disable */ var System, __instantiate; (function () { // deno-fmt-ignore diff --git a/cli/tests/025_reload_js_type_error.js b/cli/tests/025_reload_js_type_error.js index 8d6e4b415..3b7c23cc9 100644 --- a/cli/tests/025_reload_js_type_error.js +++ b/cli/tests/025_reload_js_type_error.js @@ -1,3 +1,4 @@ +// deno-lint-ignore-file // There was a bug where if this was executed with --reload it would throw a // type error. window.test = null; diff --git a/cli/tests/042_dyn_import_evalcontext.ts b/cli/tests/042_dyn_import_evalcontext.ts index f31fffee9..ccda3a972 100644 --- a/cli/tests/042_dyn_import_evalcontext.ts +++ b/cli/tests/042_dyn_import_evalcontext.ts @@ -1,4 +1,4 @@ -// @ts-expect-error +// @ts-expect-error "Deno.core" is not a public interface Deno.core.evalContext( "(async () => console.log(await import('./subdir/mod4.js')))()", ); diff --git a/cli/tests/048_media_types_jsx.ts b/cli/tests/048_media_types_jsx.ts index 54ed28e17..c2ece995a 100644 --- a/cli/tests/048_media_types_jsx.ts +++ b/cli/tests/048_media_types_jsx.ts @@ -11,10 +11,10 @@ import { loaded as loadedJsx3 } from "http://localhost:4545/cli/tests/subdir/mt_ import { loaded as loadedJsx4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx"; declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace + // deno-lint-ignore no-namespace namespace JSX { interface IntrinsicElements { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any [elemName: string]: any; } } diff --git a/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts b/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts index 479dfca79..854c1b464 100644 --- a/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts +++ b/cli/tests/060_deno_doc_displays_all_overloads_in_details_view.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file export namespace NS { export function test(name: string, fn: Function): void; export function test(options: object): void; diff --git a/cli/tests/bundle/file_tests-subdir-q.ts b/cli/tests/bundle/file_tests-subdir-q.ts index 9e5d4da37..eebe0a38b 100644 --- a/cli/tests/bundle/file_tests-subdir-q.ts +++ b/cli/tests/bundle/file_tests-subdir-q.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file export interface D { resolve: any; reject: any; diff --git a/cli/tests/complex_permissions_test.ts b/cli/tests/complex_permissions_test.ts index d7737fa2d..fba761a2c 100644 --- a/cli/tests/complex_permissions_test.ts +++ b/cli/tests/complex_permissions_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. const name = Deno.args[0]; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any const test: { [key: string]: (...args: any[]) => void | Promise<void> } = { read(files: string[]): void { files.forEach((file) => Deno.readFileSync(file)); diff --git a/cli/tests/config.ts b/cli/tests/config.ts index 6b1cb7322..cd7a1b33f 100644 --- a/cli/tests/config.ts +++ b/cli/tests/config.ts @@ -1,4 +1,5 @@ -/* eslint-disable */ +// deno-lint-ignore-file + function b() { return function ( _target: any, diff --git a/cli/tests/error_003_typescript.ts b/cli/tests/error_003_typescript.ts index e06e466e7..e1f882123 100644 --- a/cli/tests/error_003_typescript.ts +++ b/cli/tests/error_003_typescript.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file let x = { a: { b: { diff --git a/cli/tests/esm_imports_b.js b/cli/tests/esm_imports_b.js index 240a32382..840121368 100644 --- a/cli/tests/esm_imports_b.js +++ b/cli/tests/esm_imports_b.js @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file export function retb() { return "b"; } diff --git a/cli/tests/hash.ts b/cli/tests/hash.ts index 74438bd77..e3c64b642 100644 --- a/cli/tests/hash.ts +++ b/cli/tests/hash.ts @@ -1,4 +1,4 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. const { args } = Deno; import { createHash, SupportedAlgorithm } from "../../std/hash/mod.ts"; @@ -6,6 +6,7 @@ import { Md5 } from "../../std/hash/md5.ts"; import { Sha1 } from "../../std/hash/sha1.ts"; import { Sha256 } from "../../std/hash/sha256.ts"; import { Sha512 } from "../../std/hash/sha512.ts"; +// deno-lint-ignore camelcase import { Sha3_224, Sha3_256, Sha3_384, Sha3_512 } from "../../std/hash/sha3.ts"; if (args.length < 3) Deno.exit(0); @@ -14,6 +15,7 @@ const method = args[0]; const alg = args[1]; const inputFile = args[2]; +// deno-lint-ignore no-explicit-any function getJsHash(alg: string): any { switch (alg) { case "md5": diff --git a/cli/tests/ignore_require.js b/cli/tests/ignore_require.js index 118fe14e5..a8ef15021 100644 --- a/cli/tests/ignore_require.js +++ b/cli/tests/ignore_require.js @@ -1 +1,2 @@ +// deno-lint-ignore-file require("invalid module specifier"); diff --git a/cli/tests/inspector3.js b/cli/tests/inspector3.js index de079a1bc..b1b00b5a0 100644 --- a/cli/tests/inspector3.js +++ b/cli/tests/inspector3.js @@ -1,3 +1,4 @@ +// deno-lint-ignore-file for (let i = 0; i < 128; i++) { console.log(i); debugger; diff --git a/cli/tests/lock_write_fetch.ts b/cli/tests/lock_write_fetch.ts index fe05848fa..b6ecf4747 100644 --- a/cli/tests/lock_write_fetch.ts +++ b/cli/tests/lock_write_fetch.ts @@ -1,6 +1,8 @@ try { Deno.removeSync("./lock_write_fetch.json"); -} catch {} +} catch { + // pass +} const fetchProc = Deno.run({ stdout: "null", diff --git a/cli/tests/no_check_decorators.ts b/cli/tests/no_check_decorators.ts index d9a3747b9..9f7ec550d 100644 --- a/cli/tests/no_check_decorators.ts +++ b/cli/tests/no_check_decorators.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file function a() { console.log("a(): evaluated"); return ( diff --git a/cli/tests/permission_test.ts b/cli/tests/permission_test.ts index 5050efde8..f42983630 100644 --- a/cli/tests/permission_test.ts +++ b/cli/tests/permission_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. const name = Deno.args[0]; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any const test: { [key: string]: (...args: any[]) => void | Promise<void> } = { readRequired(): Promise<void> { Deno.readFileSync("README.md"); diff --git a/cli/tests/subdir/more_decorators.ts b/cli/tests/subdir/more_decorators.ts index a67ae3fd6..674705d56 100644 --- a/cli/tests/subdir/more_decorators.ts +++ b/cli/tests/subdir/more_decorators.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file function a() { console.log("a(): evaluated"); return ( diff --git a/cli/tests/subdir/throws.js b/cli/tests/subdir/throws.js index 91ce4628e..abdf29156 100644 --- a/cli/tests/subdir/throws.js +++ b/cli/tests/subdir/throws.js @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file export function boo() { console.log("Boo!"); } diff --git a/cli/tests/tla/d.js b/cli/tests/tla/d.js index 2b5fd3c45..283ebf817 100644 --- a/cli/tests/tla/d.js +++ b/cli/tests/tla/d.js @@ -1,6 +1,8 @@ import order from "./order.js"; const end = Date.now() + 500; -while (end < Date.now()) {} +while (end < Date.now()) { + // pass +} order.push("d"); diff --git a/cli/tests/ts_decorators.ts b/cli/tests/ts_decorators.ts index 67fd0604f..95fba6cd4 100644 --- a/cli/tests/ts_decorators.ts +++ b/cli/tests/ts_decorators.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file function Decorate() { return function (constructor: any): any { diff --git a/cli/tests/ts_decorators_bundle.ts b/cli/tests/ts_decorators_bundle.ts index d67ea4d5f..189edfbff 100644 --- a/cli/tests/ts_decorators_bundle.ts +++ b/cli/tests/ts_decorators_bundle.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file import { B } from "./subdir/more_decorators.ts"; diff --git a/cli/tests/ts_type_imports.ts b/cli/tests/ts_type_imports.ts index f39dc7500..73c779156 100644 --- a/cli/tests/ts_type_imports.ts +++ b/cli/tests/ts_type_imports.ts @@ -1,4 +1,4 @@ -/* eslint-disable */ +// deno-lint-ignore-file type Foo = import("./ts_type_imports_foo.ts").Foo; diff --git a/cli/tests/ts_with_generic.ts b/cli/tests/ts_with_generic.ts index aa83e73b9..1e3591f40 100644 --- a/cli/tests/ts_with_generic.ts +++ b/cli/tests/ts_with_generic.ts @@ -1,3 +1,3 @@ -/* eslint-disable */ +// deno-lint-ignore-file const foo = { delete<S>() {} }; diff --git a/cli/tests/tsc2/file_libref.ts b/cli/tests/tsc2/file_libref.ts index 8af5a83d0..6f37da139 100644 --- a/cli/tests/tsc2/file_libref.ts +++ b/cli/tests/tsc2/file_libref.ts @@ -1,3 +1,4 @@ +// deno-lint-ignore-file /// <reference no-default-lib="true"/> /// <reference lib="dom" /> /// <reference lib="deno.ns" /> diff --git a/cli/tests/type_definitions.ts b/cli/tests/type_definitions.ts index ecf3ae0b2..a1bb37a65 100644 --- a/cli/tests/type_definitions.ts +++ b/cli/tests/type_definitions.ts @@ -1,3 +1,5 @@ +// deno-lint-ignore-file + // @deno-types="./type_definitions/foo.d.ts" import { foo } from "./type_definitions/foo.js"; // @deno-types="./type_definitions/fizz.d.ts" diff --git a/cli/tests/unit/blob_test.ts b/cli/tests/unit/blob_test.ts index 5bce99e18..19125c865 100644 --- a/cli/tests/unit/blob_test.ts +++ b/cli/tests/unit/blob_test.ts @@ -46,7 +46,7 @@ unitTest(function blobShouldNotThrowError(): void { let hasThrown = false; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const options1: any = { ending: "utf8", hasOwnProperty: "hasOwnProperty", diff --git a/cli/tests/unit/body_test.ts b/cli/tests/unit/body_test.ts index 4839d4094..1e9a54815 100644 --- a/cli/tests/unit/body_test.ts +++ b/cli/tests/unit/body_test.ts @@ -2,7 +2,7 @@ import { assert, assertEquals, unitTest } from "./test_util.ts"; // just a hack to get a body object -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function buildBody(body: any, headers?: Headers): Body { const stub = new Request("http://foo/", { body: body, diff --git a/cli/tests/unit/console_test.ts b/cli/tests/unit/console_test.ts index 268432822..37112bea6 100644 --- a/cli/tests/unit/console_test.ts +++ b/cli/tests/unit/console_test.ts @@ -184,7 +184,6 @@ unitTest(function consoleTestStringifyLongStrings(): void { assertEquals(actual, veryLongString); }); -/* eslint-disable @typescript-eslint/explicit-function-return-type */ unitTest(function consoleTestStringifyCircular(): void { class Base { a = 1; @@ -196,7 +195,7 @@ unitTest(function consoleTestStringifyCircular(): void { m2() {} } - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const nestedObj: any = { num: 1, bool: true, @@ -345,7 +344,6 @@ unitTest(function consoleTestStringifyCircular(): void { // test inspect is working the same assertEquals(stripColor(Deno.inspect(nestedObj)), nestedObjExpected); }); -/* eslint-enable @typescript-eslint/explicit-function-return-type */ unitTest(function consoleTestStringifyFunctionWithPrototypeRemoved(): void { const f = function f() {}; @@ -363,7 +361,7 @@ unitTest(function consoleTestStringifyFunctionWithPrototypeRemoved(): void { }); unitTest(function consoleTestStringifyWithDepth(): void { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const nestedObj: any = { a: { b: { c: { d: { e: { f: 42 } } } } } }; assertEquals( stripColor(inspectArgs([nestedObj], { depth: 3 })), @@ -1144,7 +1142,7 @@ class StringBuffer { } type ConsoleExamineFunc = ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any csl: any, out: StringBuffer, err?: StringBuffer, diff --git a/cli/tests/unit/dispatch_json_test.ts b/cli/tests/unit/dispatch_json_test.ts index ce7778e2d..1288384e3 100644 --- a/cli/tests/unit/dispatch_json_test.ts +++ b/cli/tests/unit/dispatch_json_test.ts @@ -1,9 +1,9 @@ import { assertMatch, assertStrictEquals, unitTest } from "./test_util.ts"; declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace + // deno-lint-ignore no-namespace namespace Deno { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any var core: any; // eslint-disable-line no-var } } diff --git a/cli/tests/unit/dispatch_minimal_test.ts b/cli/tests/unit/dispatch_minimal_test.ts index e10acfc54..234ba6a1c 100644 --- a/cli/tests/unit/dispatch_minimal_test.ts +++ b/cli/tests/unit/dispatch_minimal_test.ts @@ -26,9 +26,9 @@ unitTest(async function sendAsyncStackTrace(): Promise<void> { }); declare global { - // eslint-disable-next-line @typescript-eslint/no-namespace + // deno-lint-ignore no-namespace namespace Deno { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any var core: any; // eslint-disable-line no-var } } diff --git a/cli/tests/unit/dom_iterable_test.ts b/cli/tests/unit/dom_iterable_test.ts index 30599b6e6..e767d2ba1 100644 --- a/cli/tests/unit/dom_iterable_test.ts +++ b/cli/tests/unit/dom_iterable_test.ts @@ -75,7 +75,7 @@ unitTest(function testDomIterableScope(): void { const domIterable = new DomIterable([["foo", 1]]); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any function checkScope(thisArg: any, expected: any): void { function callback(this: typeof thisArg): void { assertEquals(this, expected); diff --git a/cli/tests/unit/error_stack_test.ts b/cli/tests/unit/error_stack_test.ts index d795a2951..a5fe13796 100644 --- a/cli/tests/unit/error_stack_test.ts +++ b/cli/tests/unit/error_stack_test.ts @@ -7,7 +7,7 @@ const { setPrepareStackTrace } = Deno[Deno.internal]; interface CallSite { getThis(): unknown; getTypeName(): string | null; - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types getFunction(): Function | null; getFunctionName(): string | null; getMethodName(): string | null; @@ -36,7 +36,7 @@ function getMockCallSite( getTypeName(): string { return ""; }, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types getFunction(): Function { return (): void => {}; }, @@ -125,7 +125,7 @@ unitTest(function errorStackMessageLine(): void { // FIXME(bartlomieju): no longer works after migrating // to JavaScript runtime code unitTest({ ignore: true }, function prepareStackTrace(): void { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const MockError = {} as any; setPrepareStackTrace(MockError); assert(typeof MockError.prepareStackTrace === "function"); diff --git a/cli/tests/unit/event_test.ts b/cli/tests/unit/event_test.ts index d624a54a5..02abff557 100644 --- a/cli/tests/unit/event_test.ts +++ b/cli/tests/unit/event_test.ts @@ -68,7 +68,7 @@ unitTest(function eventPreventDefaultSuccess(): void { }); unitTest(function eventInitializedWithNonStringType(): void { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const type: any = undefined; const event = new Event(type); @@ -94,7 +94,7 @@ unitTest(function eventIsTrusted(): void { }); unitTest(function eventInspectOutput(): void { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const cases: Array<[any, (event: any) => string]> = [ [ new Event("test"), diff --git a/cli/tests/unit/fetch_test.ts b/cli/tests/unit/fetch_test.ts index ab9299711..681eefad4 100644 --- a/cli/tests/unit/fetch_test.ts +++ b/cli/tests/unit/fetch_test.ts @@ -84,7 +84,7 @@ unitTest({ perms: { net: true } }, async function fetchBodyUsed(): Promise< const response = await fetch("http://localhost:4545/cli/tests/fixture.json"); assertEquals(response.bodyUsed, false); assertThrows((): void => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (response as any).bodyUsed = true; }); await response.blob(); diff --git a/cli/tests/unit/file_test.ts b/cli/tests/unit/file_test.ts index 5abd0e26e..f610f6d6b 100644 --- a/cli/tests/unit/file_test.ts +++ b/cli/tests/unit/file_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { assert, assertEquals, unitTest } from "./test_util.ts"; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function testFirstArgument(arg1: any[], expectedSize: number): void { const file = new File(arg1, "name"); assert(file instanceof File); @@ -77,7 +77,7 @@ unitTest(function fileObjectInFileBits(): void { testFirstArgument([{}], 15); }); -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function testSecondArgument(arg2: any, expectedFileName: string): void { const file = new File(["bits"], arg2); assert(file instanceof File); diff --git a/cli/tests/unit/files_test.ts b/cli/tests/unit/files_test.ts index 7f0de5851..02185bc76 100644 --- a/cli/tests/unit/files_test.ts +++ b/cli/tests/unit/files_test.ts @@ -319,7 +319,7 @@ unitTest( // writing null should throw an error await assertThrowsAsync( async (): Promise<void> => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any await file.write(null as any); }, ); // TODO: Check error kind when dispatch_minimal pipes errors properly @@ -346,7 +346,7 @@ unitTest( // reading file into null buffer should throw an error await assertThrowsAsync(async () => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any await file.read(null as any); }, TypeError); // TODO: Check error kind when dispatch_minimal pipes errors properly diff --git a/cli/tests/unit/form_data_test.ts b/cli/tests/unit/form_data_test.ts index fc59c1a0d..40fdbfaa7 100644 --- a/cli/tests/unit/form_data_test.ts +++ b/cli/tests/unit/form_data_test.ts @@ -41,9 +41,9 @@ unitTest(function formDataParamsGetSuccess(): void { formData.append("a", "true"); formData.append("b", "false"); formData.append("a", "null"); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any formData.append("d", undefined as any); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any formData.append("e", null as any); assertEquals(formData.get("a"), "true"); assertEquals(formData.get("b"), "false"); @@ -70,10 +70,10 @@ unitTest(function formDataParamsSetSuccess(): void { assertEquals(formData.getAll("b"), ["false"]); formData.set("a", "false"); assertEquals(formData.getAll("a"), ["false"]); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any formData.set("d", undefined as any); assertEquals(formData.get("d"), "undefined"); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any formData.set("e", null as any); assertEquals(formData.get("e"), "null"); }); @@ -143,7 +143,7 @@ unitTest(function formDataParamsArgumentsCheck(): void { let hasThrown = 0; let errMsg = ""; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (formData as any)[method](); hasThrown = 1; } catch (err) { @@ -167,7 +167,7 @@ unitTest(function formDataParamsArgumentsCheck(): void { let errMsg = ""; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (formData as any)[method](); hasThrown = 1; } catch (err) { @@ -187,7 +187,7 @@ unitTest(function formDataParamsArgumentsCheck(): void { hasThrown = 0; errMsg = ""; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (formData as any)[method]("foo"); hasThrown = 1; } catch (err) { diff --git a/cli/tests/unit/format_error_test.ts b/cli/tests/unit/format_error_test.ts index f769cc18c..5e49fc11b 100644 --- a/cli/tests/unit/format_error_test.ts +++ b/cli/tests/unit/format_error_test.ts @@ -27,7 +27,7 @@ unitTest(function formatDiagnosticBasic() { unitTest(function formatDiagnosticError() { let thrown = false; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const bad = ([{ hello: 123 }] as any) as Deno.Diagnostic[]; try { Deno.formatDiagnostics(bad); diff --git a/cli/tests/unit/globals_test.ts b/cli/tests/unit/globals_test.ts index 53fafc5b6..422bd2aec 100644 --- a/cli/tests/unit/globals_test.ts +++ b/cli/tests/unit/globals_test.ts @@ -60,7 +60,6 @@ unitTest(function webAssemblyExists(): void { assert(typeof WebAssembly.compile === "function"); }); -/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-explicit-any,no-var */ declare global { // deno-lint-ignore no-namespace namespace Deno { @@ -68,26 +67,25 @@ declare global { var core: any; } } -/* eslint-enable */ unitTest(function DenoNamespaceImmutable(): void { const denoCopy = window.Deno; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (Deno as any) = 1; } catch { // pass } assert(denoCopy === Deno); try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (window as any).Deno = 1; } catch { // pass } assert(denoCopy === Deno); try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any delete (window as any).Deno; } catch { // pass @@ -96,14 +94,14 @@ unitTest(function DenoNamespaceImmutable(): void { const { readFile } = Deno; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (Deno as any).readFile = 1; } catch { // pass } assert(readFile === Deno.readFile); try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any delete (window as any).Deno.readFile; } catch { // pass diff --git a/cli/tests/unit/headers_test.ts b/cli/tests/unit/headers_test.ts index fba6f19c4..36288aaa0 100644 --- a/cli/tests/unit/headers_test.ts +++ b/cli/tests/unit/headers_test.ts @@ -22,7 +22,7 @@ unitTest(function newHeaderTest(): void { new Headers(undefined); new Headers({}); try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any new Headers(null as any); } catch (e) { assertEquals( @@ -36,11 +36,11 @@ const headerDict: Record<string, string> = { name1: "value1", name2: "value2", name3: "value3", - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any name4: undefined as any, "Content-Type": "value4", }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any const headerSeq: any[] = []; for (const name in headerDict) { headerSeq.push([name, headerDict[name]]); @@ -273,7 +273,7 @@ unitTest(function headerParamsArgumentsCheck(): void { let hasThrown = 0; let errMsg = ""; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (headers as any)[method](); hasThrown = 1; } catch (err) { @@ -297,7 +297,7 @@ unitTest(function headerParamsArgumentsCheck(): void { let errMsg = ""; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (headers as any)[method](); hasThrown = 1; } catch (err) { @@ -317,7 +317,7 @@ unitTest(function headerParamsArgumentsCheck(): void { hasThrown = 0; errMsg = ""; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (headers as any)[method]("foo"); hasThrown = 1; } catch (err) { diff --git a/cli/tests/unit/permissions_test.ts b/cli/tests/unit/permissions_test.ts index ed6298ee8..eada8fe9a 100644 --- a/cli/tests/unit/permissions_test.ts +++ b/cli/tests/unit/permissions_test.ts @@ -3,7 +3,7 @@ import { assertThrows, assertThrowsAsync, unitTest } from "./test_util.ts"; unitTest(async function permissionInvalidName(): Promise<void> { await assertThrowsAsync(async () => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any await Deno.permissions.query({ name: "foo" as any }); }, Error); }); diff --git a/cli/tests/unit/request_test.ts b/cli/tests/unit/request_test.ts index 6fc8c0eb5..8132e0184 100644 --- a/cli/tests/unit/request_test.ts +++ b/cli/tests/unit/request_test.ts @@ -10,7 +10,7 @@ unitTest(function fromInit(): void { }, }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assertEquals("ahoyhoy", (req as any)._bodySource); assertEquals(req.url, "http://foo/"); assertEquals(req.headers.get("test-header"), "value"); @@ -18,13 +18,13 @@ unitTest(function fromInit(): void { unitTest(function fromRequest(): void { const r = new Request("http://foo/"); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (r as any)._bodySource = "ahoyhoy"; r.headers.set("test-header", "value"); const req = new Request(r); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assertEquals((req as any)._bodySource, (r as any)._bodySource); assertEquals(req.url, r.url); assertEquals(req.headers.get("test-header"), r.headers.get("test-header")); @@ -64,6 +64,6 @@ unitTest(async function cloneRequestBodyStream(): Promise<void> { assertEquals(b1, b2); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assert((r1 as any)._bodySource !== (r2 as any)._bodySource); }); diff --git a/cli/tests/unit/streams_internal_test.ts b/cli/tests/unit/streams_internal_test.ts index 096fcef3c..7d36c98c0 100644 --- a/cli/tests/unit/streams_internal_test.ts +++ b/cli/tests/unit/streams_internal_test.ts @@ -2,7 +2,7 @@ import { assertThrows, unitTest } from "./test_util.ts"; unitTest(function streamReadableHwmError() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"]; for (const highWaterMark of invalidHwm) { assertThrows( @@ -17,14 +17,14 @@ unitTest(function streamReadableHwmError() { assertThrows(() => { new ReadableStream<number>( undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any { highWaterMark: Symbol("hwk") as any }, ); }, TypeError); }); unitTest(function streamWriteableHwmError() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"]; for (const highWaterMark of invalidHwm) { assertThrows( @@ -42,14 +42,14 @@ unitTest(function streamWriteableHwmError() { assertThrows(() => { new WritableStream( undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any new CountQueuingStrategy({ highWaterMark: Symbol("hwmk") as any }), ); }, TypeError); }); unitTest(function streamTransformHwmError() { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"]; for (const highWaterMark of invalidHwm) { assertThrows( @@ -65,7 +65,7 @@ unitTest(function streamTransformHwmError() { new TransformStream( undefined, undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any { highWaterMark: Symbol("hwmk") as any }, ); }, TypeError); diff --git a/cli/tests/unit/streams_transform_test.ts b/cli/tests/unit/streams_transform_test.ts index b07fccffb..464f269fc 100644 --- a/cli/tests/unit/streams_transform_test.ts +++ b/cli/tests/unit/streams_transform_test.ts @@ -506,7 +506,7 @@ unitTest(async function transformStreamStartCalledOnce() { unitTest(function transformStreamReadableTypeThrows() { assertThrows( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any () => new TransformStream({ readableType: "bytes" as any }), RangeError, undefined, @@ -516,7 +516,7 @@ unitTest(function transformStreamReadableTypeThrows() { unitTest(function transformStreamWirtableTypeThrows() { assertThrows( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any () => new TransformStream({ writableType: "bytes" as any }), RangeError, undefined, diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts index 5212ba0f8..672c7defc 100644 --- a/cli/tests/unit/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -189,7 +189,7 @@ export function unitTest( export interface ResolvableMethods<T> { resolve: (value?: T | PromiseLike<T>) => void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any reject: (reason?: any) => void; } @@ -208,7 +208,7 @@ export function createResolvable<T>(): Resolvable<T> { const encoder = new TextEncoder(); // Replace functions with null, errors with their stack strings, and JSONify. -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function serializeTestMessage(message: any): string { return JSON.stringify({ start: message.start && { @@ -225,7 +225,7 @@ function serializeTestMessage(message: any): string { }, end: message.end && { ...message.end, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any results: message.end.results.map((result: any) => ({ ...result, error: result.error?.stack, @@ -236,7 +236,7 @@ function serializeTestMessage(message: any): string { export async function reportToConn( conn: Deno.Conn, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any message: any, ): Promise<void> { const line = serializeTestMessage(message); diff --git a/cli/tests/unit/unit_test_runner.ts b/cli/tests/unit/unit_test_runner.ts index 07793085a..35a691ebd 100755 --- a/cli/tests/unit/unit_test_runner.ts +++ b/cli/tests/unit/unit_test_runner.ts @@ -15,15 +15,15 @@ import { // @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol const internalObj = Deno[Deno.internal]; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any const reportToConsole = internalObj.reportToConsole as (message: any) => void; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any const runTests = internalObj.runTests as (options: any) => Promise<any>; interface PermissionSetTestResult { perms: Permissions; passed: boolean; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any endMessage: any; permsStr: string; } @@ -135,12 +135,12 @@ async function runTestsForPermissionSet( const conn = await listener.accept(); let expectedPassedTests; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any let endMessage: any; try { for await (const line of readLines(conn)) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const message = JSON.parse(line) as any; reportToConsole(message); if (message.start != null) { diff --git a/cli/tests/unit/url_search_params_test.ts b/cli/tests/unit/url_search_params_test.ts index dc0e8bd85..4c1d00c85 100644 --- a/cli/tests/unit/url_search_params_test.ts +++ b/cli/tests/unit/url_search_params_test.ts @@ -102,7 +102,7 @@ unitTest(function urlSearchParamsInitRecord(): void { unitTest(function urlSearchParamsInit(): void { const params1 = new URLSearchParams("a=b"); assertEquals(params1.toString(), "a=b"); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const params2 = new URLSearchParams(params1 as any); assertEquals(params2.toString(), "a=b"); }); @@ -257,7 +257,7 @@ unitTest(function urlSearchParamsAppendArgumentsCheck(): void { const searchParams = new URLSearchParams(); let hasThrown = 0; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (searchParams as any)[method](); hasThrown = 1; } catch (err) { @@ -274,7 +274,7 @@ unitTest(function urlSearchParamsAppendArgumentsCheck(): void { const searchParams = new URLSearchParams(); let hasThrown = 0; try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (searchParams as any)[method]("foo"); hasThrown = 1; } catch (err) { @@ -315,7 +315,7 @@ unitTest(function urlSearchParamsCustomSymbolIterator(): void { unitTest( function urlSearchParamsCustomSymbolIteratorWithNonStringParams(): void { const params = {}; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (params as any)[Symbol.iterator] = function* (): IterableIterator< [number, number] > { diff --git a/cli/tests/workers_round_robin_bench.ts b/cli/tests/workers_round_robin_bench.ts index 90ebb0364..e97970f27 100644 --- a/cli/tests/workers_round_robin_bench.ts +++ b/cli/tests/workers_round_robin_bench.ts @@ -7,7 +7,7 @@ const cmdsPerWorker = 400; export interface ResolvableMethods<T> { resolve: (value?: T | PromiseLike<T>) => void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any reject: (reason?: any) => void; } diff --git a/cli/tests/workers_test.ts b/cli/tests/workers_test.ts index 06349efa0..31dc72deb 100644 --- a/cli/tests/workers_test.ts +++ b/cli/tests/workers_test.ts @@ -11,7 +11,7 @@ import { assert, assertEquals } from "../../std/testing/asserts.ts"; export interface ResolvableMethods<T> { resolve: (value?: T | PromiseLike<T>) => void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any reject: (reason?: any) => void; } @@ -93,7 +93,7 @@ Deno.test({ { type: "module" }, ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any throwingWorker.onerror = (e: any): void => { e.preventDefault(); assert(/Uncaught Error: Thrown error/.test(e.message)); @@ -133,7 +133,7 @@ Deno.test({ { type: "module" }, ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any fetchingWorker.onerror = (e: any): void => { e.preventDefault(); promise.reject(e.message); diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index 33f34b806..5ef9bca65 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -1,5 +1,7 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +// deno-lint-ignore-file no-undef + // This module is the entry point for "compiler" isolate, ie. the one // that is created when Deno needs to type check TypeScript, and in some // instances convert TypeScript to JavaScript. @@ -234,7 +236,7 @@ delete Object.prototype.__proto__; specifiers, base, }); - let r = resolved.map(([resolvedFileName, extension]) => ({ + const r = resolved.map(([resolvedFileName, extension]) => ({ resolvedFileName, extension, isExternalLibraryImport: false, @@ -357,7 +359,7 @@ delete Object.prototype.__proto__; /** @type {{ buildSpecifier: string; libs: string[] }} */ const { buildSpecifier, libs } = core.jsonOpSync("op_build_info", {}); for (const lib of libs) { - let specifier = `lib.${lib}.d.ts`; + const specifier = `lib.${lib}.d.ts`; // we are using internal APIs here to "inject" our custom libraries into // tsc, so things like `"lib": [ "deno.ns" ]` are supported. if (!ts.libs.includes(lib)) { |