diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-11-03 16:19:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-03 16:19:29 +0100 |
commit | 8e914be7420715620cad74fbb020c5e87ac875a2 (patch) | |
tree | 2fefc0111f85533de2bd24e54f70c6c1241e3d3b /std/node/_util | |
parent | e736d0f60f6cdf38e2d317ee08a7125de9e57d69 (diff) |
build: migrate to dlint (#8176)
This commit migrates repository from using "eslint"
to "dlint" for linting JavaScript code.
Diffstat (limited to 'std/node/_util')
-rw-r--r-- | std/node/_util/_util_callbackify.ts | 2 | ||||
-rw-r--r-- | std/node/_util/_util_callbackify_test.ts | 24 | ||||
-rw-r--r-- | std/node/_util/_util_promisify.ts | 14 | ||||
-rw-r--r-- | std/node/_util/_util_promisify_test.ts | 2 |
4 files changed, 21 insertions, 21 deletions
diff --git a/std/node/_util/_util_callbackify.ts b/std/node/_util/_util_callbackify.ts index b37bf829a..a50816346 100644 --- a/std/node/_util/_util_callbackify.ts +++ b/std/node/_util/_util_callbackify.ts @@ -84,7 +84,7 @@ function callbackify<Arg1T, Arg2T, Arg3T, Arg4T, Arg5T, ResultT>( callback: Callback<ResultT>, ) => void; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function callbackify(original: any): any { if (typeof original !== "function") { throw new NodeInvalidArgTypeError('"original"'); diff --git a/std/node/_util/_util_callbackify_test.ts b/std/node/_util/_util_callbackify_test.ts index 465626e7b..4a87eb355 100644 --- a/std/node/_util/_util_callbackify_test.ts +++ b/std/node/_util/_util_callbackify_test.ts @@ -105,10 +105,10 @@ Deno.test( }); }); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const thenableFn = (): PromiseLike<any> => { return { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any then(onfulfilled): PromiseLike<any> { assert(onfulfilled); onfulfilled(value); @@ -150,11 +150,11 @@ Deno.test( if ("reason" in err) { assert(!value); assertStrictEquals( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (err as any).code, "ERR_FALSY_VALUE_REJECTION", ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assertStrictEquals((err as any).reason, value); } else { assertStrictEquals(String(value).endsWith(err.message), true); @@ -186,11 +186,11 @@ Deno.test( if ("reason" in err) { assert(!value); assertStrictEquals( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (err as any).code, "ERR_FALSY_VALUE_REJECTION", ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assertStrictEquals((err as any).reason, value); } else { assertStrictEquals(String(value).endsWith(err.message), true); @@ -220,11 +220,11 @@ Deno.test( if ("reason" in err) { assert(!value); assertStrictEquals( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (err as any).code, "ERR_FALSY_VALUE_REJECTION", ); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assertStrictEquals((err as any).reason, value); } else { assertStrictEquals(String(value).endsWith(err.message), true); @@ -341,12 +341,12 @@ Deno.test("callbackify preserves the `this` binding", async () => { Deno.test("callbackify throws with non-function inputs", () => { ["foo", null, undefined, false, 0, {}, Symbol(), []].forEach((value) => { try { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any callbackify(value as any); throw Error("We should never reach this error"); } catch (err) { assert(err instanceof TypeError); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assertStrictEquals((err as any).code, "ERR_INVALID_ARG_TYPE"); assertStrictEquals(err.name, "TypeError"); assertStrictEquals( @@ -365,7 +365,7 @@ Deno.test( return 42; } - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const cb = callbackify(asyncFn) as any; const args: unknown[] = []; @@ -377,7 +377,7 @@ Deno.test( throw Error("We should never reach this error"); } catch (err) { assert(err instanceof TypeError); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any assertStrictEquals((err as any).code, "ERR_INVALID_ARG_TYPE"); assertStrictEquals(err.name, "TypeError"); assertStrictEquals( diff --git a/std/node/_util/_util_promisify.ts b/std/node/_util/_util_promisify.ts index 6aeee8ecf..91bbcacfa 100644 --- a/std/node/_util/_util_promisify.ts +++ b/std/node/_util/_util_promisify.ts @@ -57,16 +57,16 @@ class NodeInvalidArgTypeError extends TypeError { } export function promisify( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any original: (...args: any[]) => void, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any ): (...args: any[]) => Promise<any> { if (typeof original !== "function") { throw new NodeInvalidArgTypeError("original", "Function", original); } - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any if ((original as any)[kCustomPromisifiedSymbol]) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const fn = (original as any)[kCustomPromisifiedSymbol]; if (typeof fn !== "function") { throw new NodeInvalidArgTypeError( @@ -85,9 +85,9 @@ export function promisify( // Names to create an object from in case the callback receives multiple // arguments, e.g. ['bytesRead', 'buffer'] for fs.read. - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const argumentNames = (original as any)[kCustomPromisifyArgsSymbol]; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any function fn(this: any, ...args: unknown[]): Promise<unknown> { return new Promise((resolve, reject) => { original.call(this, ...args, (err: Error, ...values: unknown[]) => { @@ -97,7 +97,7 @@ export function promisify( if (argumentNames !== undefined && values.length > 1) { const obj = {}; for (let i = 0; i < argumentNames.length; i++) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (obj as any)[argumentNames[i]] = values[i]; } resolve(obj); diff --git a/std/node/_util/_util_promisify_test.ts b/std/node/_util/_util_promisify_test.ts index 6271a8581..1e3656769 100644 --- a/std/node/_util/_util_promisify_test.ts +++ b/std/node/_util/_util_promisify_test.ts @@ -29,7 +29,7 @@ import { import { promisify } from "./_util_promisify.ts"; import * as fs from "../fs.ts"; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any type VoidFunction = (...args: any[]) => void; const readFile = promisify(fs.readFile); |