diff options
Diffstat (limited to 'cli/tests')
48 files changed, 102 insertions, 93 deletions
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); |