diff options
Diffstat (limited to 'std/node')
-rw-r--r-- | std/node/_fs/_fs_common.ts | 2 | ||||
-rw-r--r-- | std/node/_fs/_fs_dir.ts | 4 | ||||
-rw-r--r-- | std/node/_fs/_fs_dir_test.ts | 6 | ||||
-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 | ||||
-rw-r--r-- | std/node/_utils.ts | 8 | ||||
-rw-r--r-- | std/node/assertion_error.ts | 4 | ||||
-rw-r--r-- | std/node/buffer.ts | 4 | ||||
-rw-r--r-- | std/node/events.ts | 38 | ||||
-rw-r--r-- | std/node/events_test.ts | 4 | ||||
-rw-r--r-- | std/node/global.ts | 2 | ||||
-rw-r--r-- | std/node/module.ts | 42 | ||||
-rw-r--r-- | std/node/module_test.ts | 1 | ||||
-rw-r--r-- | std/node/os.ts | 1 | ||||
-rw-r--r-- | std/node/process.ts | 12 | ||||
-rw-r--r-- | std/node/querystring.ts | 2 | ||||
-rw-r--r-- | std/node/tests/cjs/cjs_a.js | 2 | ||||
-rw-r--r-- | std/node/tests/cjs/cjs_builtin.js | 2 | ||||
-rw-r--r-- | std/node/timers.ts | 4 | ||||
-rw-r--r-- | std/node/util.ts | 2 |
22 files changed, 90 insertions, 92 deletions
diff --git a/std/node/_fs/_fs_common.ts b/std/node/_fs/_fs_common.ts index fa1a52429..0b1ffe0bb 100644 --- a/std/node/_fs/_fs_common.ts +++ b/std/node/_fs/_fs_common.ts @@ -49,7 +49,7 @@ export function getEncoding( optOrCallback?: | FileOptions | WriteFileOptions - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any | ((...args: any[]) => any) | Encodings | null, diff --git a/std/node/_fs/_fs_dir.ts b/std/node/_fs/_fs_dir.ts index 1fd7d60dd..18d104981 100644 --- a/std/node/_fs/_fs_dir.ts +++ b/std/node/_fs/_fs_dir.ts @@ -18,7 +18,7 @@ export default class Dir { return this.dirPath; } - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any read(callback?: (...args: any[]) => void): Promise<Dirent | null> { return new Promise((resolve, reject) => { if (!this.asyncIterator) { @@ -57,7 +57,7 @@ export default class Dir { * directories, and therefore does not need to close directories when * finished reading. */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any close(callback?: (...args: any[]) => void): Promise<void> { return new Promise((resolve, reject) => { try { diff --git a/std/node/_fs/_fs_dir_test.ts b/std/node/_fs/_fs_dir_test.ts index 522bd9bcd..0dea64c81 100644 --- a/std/node/_fs/_fs_dir_test.ts +++ b/std/node/_fs/_fs_dir_test.ts @@ -7,7 +7,7 @@ Deno.test({ name: "Closing current directory with callback is successful", fn() { let calledBack = false; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any new Dir(".").close((valOrErr: any) => { assert(!valOrErr); calledBack = true; @@ -51,7 +51,7 @@ Deno.test({ let calledBack = false; const fileFromCallback: Dirent | null = await new Dir( testDir, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any ).read((err: any, res: Dirent) => { assert(res === null); assert(err === null); @@ -81,7 +81,7 @@ Deno.test({ const dir: Dir = new Dir(testDir); const firstRead: Dirent | null = await dir.read(); const secondRead: Dirent | null = await dir.read( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any (err: any, secondResult: Dirent) => { assert( secondResult.name === "bar.txt" || 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); diff --git a/std/node/_utils.ts b/std/node/_utils.ts index e63b53d18..b2745bf5a 100644 --- a/std/node/_utils.ts +++ b/std/node/_utils.ts @@ -18,10 +18,10 @@ export type MaybeDefined<T> = T | undefined; export type MaybeEmpty<T> = T | null | undefined; export function intoCallbackAPI<T>( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any func: (...args: any[]) => Promise<T>, cb: MaybeEmpty<(err: MaybeNull<Error>, value: MaybeEmpty<T>) => void>, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any ...args: any[] ): void { func(...args) @@ -30,11 +30,11 @@ export function intoCallbackAPI<T>( } export function intoCallbackAPIWithIntercept<T1, T2>( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any func: (...args: any[]) => Promise<T1>, interceptor: (v: T1) => T2, cb: MaybeEmpty<(err: MaybeNull<Error>, value: MaybeEmpty<T2>) => void>, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any ...args: any[] ): void { func(...args) diff --git a/std/node/assertion_error.ts b/std/node/assertion_error.ts index 46122b658..09e882f01 100644 --- a/std/node/assertion_error.ts +++ b/std/node/assertion_error.ts @@ -363,10 +363,10 @@ export interface AssertionErrorConstructorOptions { expected?: unknown; operator?: string; details?: AssertionErrorDetailsDescriptor[]; - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types stackStartFn?: Function; // Compatibility with older versions. - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types stackStartFunction?: Function; } diff --git a/std/node/buffer.ts b/std/node/buffer.ts index b806f8f3a..6d307b6df 100644 --- a/std/node/buffer.ts +++ b/std/node/buffer.ts @@ -204,7 +204,7 @@ export default class Buffer extends Uint8Array { */ static from(string: string, encoding?: string): Buffer; static from( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any value: any, offsetOrEncoding?: number | string, length?: number, @@ -234,7 +234,7 @@ export default class Buffer extends Uint8Array { return obj instanceof Buffer; } - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any static isEncoding(encoding: any): boolean { return ( typeof encoding === "string" && diff --git a/std/node/events.ts b/std/node/events.ts index d7c2275a0..568393f7f 100644 --- a/std/node/events.ts +++ b/std/node/events.ts @@ -24,7 +24,7 @@ import { validateIntegerRange } from "./_utils.ts"; import { assert } from "../_util/assert.ts"; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any export type GenericFunction = (...args: any[]) => any; export interface WrappedFunction extends Function { @@ -93,7 +93,7 @@ export default class EventEmitter { * arguments to each. * @return true if the event had listeners, false otherwise */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any public emit(eventName: string | symbol, ...args: any[]): boolean { if (this._events.has(eventName)) { if ( @@ -170,7 +170,7 @@ export default class EventEmitter { private unwrapListeners(arr: GenericFunction[]): GenericFunction[] { const unwrappedListeners = new Array(arr.length) as GenericFunction[]; for (let i = 0; i < arr.length; i++) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any unwrappedListeners[i] = (arr[i] as any)["listener"] || arr[i]; } return unwrappedListeners; @@ -232,7 +232,7 @@ export default class EventEmitter { rawListener: GenericFunction | WrappedFunction; context: EventEmitter; }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any ...args: any[] ): void { this.context.removeListener( @@ -379,7 +379,7 @@ export { EventEmitter }; export function once( emitter: EventEmitter | EventTarget, name: string, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any ): Promise<any[]> { return new Promise((resolve, reject) => { if (emitter instanceof EventTarget) { @@ -394,7 +394,7 @@ export function once( ); return; } else if (emitter instanceof EventEmitter) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const eventListener = (...args: any[]): void => { if (errorListener !== undefined) { emitter.removeListener("error", errorListener); @@ -410,7 +410,7 @@ export function once( // memory or file descriptor leaks, which is something // we should avoid. if (name !== "error") { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any errorListener = (err: any): void => { emitter.removeListener(name, eventListener); reject(err); @@ -425,18 +425,18 @@ export function once( }); } -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function createIterResult(value: any, done: boolean): IteratorResult<any> { return { value, done }; } interface AsyncInterable { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any next(): Promise<IteratorResult<any, any>>; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any return(): Promise<IteratorResult<any, any>>; throw(err: Error): void; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any [Symbol.asyncIterator](): any; } @@ -450,18 +450,18 @@ export function on( emitter: EventEmitter, event: string | symbol, ): AsyncInterable { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const unconsumedEventValues: any[] = []; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const unconsumedPromises: any[] = []; let error: Error | null = null; let finished = false; const iterator = { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any next(): Promise<IteratorResult<any>> { // First, we consume all unread events - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const value: any = unconsumedEventValues.shift(); if (value) { return Promise.resolve(createIterResult(value, false)); @@ -488,7 +488,7 @@ export function on( }); }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any return(): Promise<IteratorResult<any>> { emitter.removeListener(event, eventHandler); emitter.removeListener("error", errorHandler); @@ -507,7 +507,7 @@ export function on( emitter.removeListener("error", errorHandler); }, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any [Symbol.asyncIterator](): any { return this; }, @@ -518,7 +518,7 @@ export function on( return iterator; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any function eventHandler(...args: any[]): void { const promise = unconsumedPromises.shift(); if (promise) { @@ -528,7 +528,7 @@ export function on( } } - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any function errorHandler(err: any): void { finished = true; diff --git a/std/node/events_test.ts b/std/node/events_test.ts index b8324c74f..20d68baa3 100644 --- a/std/node/events_test.ts +++ b/std/node/events_test.ts @@ -408,7 +408,7 @@ Deno.test({ setTimeout(() => { ee.emit("event", 42, "foo"); }, 0); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const valueArr: any[] = await once(ee, "event"); assertEquals(valueArr, [42, "foo"]); }, @@ -422,7 +422,7 @@ Deno.test({ const event: Event = new Event("event", { composed: true }); et.dispatchEvent(event); }, 0); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const eventObj: any[] = await once(et, "event"); assert(!eventObj[0].isTrusted); }, diff --git a/std/node/global.ts b/std/node/global.ts index 2f894c8e5..3037cf23e 100644 --- a/std/node/global.ts +++ b/std/node/global.ts @@ -7,7 +7,7 @@ Object.defineProperty(globalThis, Symbol.toStringTag, { configurable: true, }); -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any (globalThis as any)["global"] = globalThis; export {}; diff --git a/std/node/module.ts b/std/node/module.ts index a9a1b38d8..c8c02bad3 100644 --- a/std/node/module.ts +++ b/std/node/module.ts @@ -81,7 +81,7 @@ function updateChildren( class Module { id: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any exports: any; parent: Module | null; filename: string | null; @@ -102,7 +102,7 @@ class Module { } static builtinModules: string[] = []; static _extensions: { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any [key: string]: (module: Module, filename: string) => any; } = Object.create(null); static _cache: { [key: string]: Module } = Object.create(null); @@ -116,7 +116,7 @@ class Module { // Loads a module at the given file path. Returns that module's // `exports` property. - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any require(id: string): any { if (id === "") { throw new Error(`id '${id}' must be a non-empty string`); @@ -146,7 +146,7 @@ class Module { // the correct helper variables (require, module, exports) to // the file. // Returns exception, if any. - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any _compile(content: string, filename: string): any { // manifest code removed const compiledWrapper = wrapSafe(filename, content); @@ -348,7 +348,7 @@ class Module { // 3. Otherwise, create a new module for the file and save it to the cache. // Then have it load the file contents before returning its exports // object. - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any static _load(request: string, parent: Module, isMain: boolean): any { let relResolveCacheIdentifier: string | undefined; if (parent) { @@ -587,7 +587,7 @@ class Module { // Polyfills. const nativeModulePolyfill = new Map<string, Module>(); -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function createNativeModule(id: string, exports: any): Module { const mod = new Module(id); mod.exports = exports; @@ -643,9 +643,9 @@ const packageJsonCache = new Map<string, PackageInfo | null>(); interface PackageInfo { name?: string; main?: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any exports?: any; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any type?: any; } @@ -714,7 +714,7 @@ function readPackageMain(requestPath: string): string | undefined { return pkg ? pkg.main : undefined; } -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function readPackageExports(requestPath: string): any | undefined { const pkg = readPackage(requestPath); return pkg ? pkg.exports : undefined; @@ -806,7 +806,7 @@ function findLongestRegisteredExtension(filename: string): string { // --experimental-resolve-self trySelf() support removed. -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function isConditionalDotExportSugar(exports: any, _basePath: string): boolean { if (typeof exports === "string") return true; if (Array.isArray(exports)) return true; @@ -916,7 +916,7 @@ function resolveExports( function resolveExportsTarget( pkgPath: URL, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any target: any, subpath: string, basePath: string, @@ -993,7 +993,7 @@ function resolveExportsTarget( const nmChars = [115, 101, 108, 117, 100, 111, 109, 95, 101, 100, 111, 110]; const nmLen = nmChars.length; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function emitCircularRequireWarning(prop: any): void { console.error( `Accessing non-existent property '${ @@ -1007,7 +1007,7 @@ function emitCircularRequireWarning(prop: any): void { const CircularRequirePrototypeWarningProxy = new Proxy( {}, { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any get(target: Record<string, any>, prop: string): any { if (prop in target) return target[prop]; emitCircularRequireWarning(prop); @@ -1028,7 +1028,7 @@ const CircularRequirePrototypeWarningProxy = new Proxy( // and are not identical to the versions on the global object. const PublicObjectPrototype = window.Object.prototype; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any function getExportsForCircularRequire(module: Module): any { if ( module.exports && @@ -1047,9 +1047,9 @@ function getExportsForCircularRequire(module: Module): any { } type RequireWrapper = ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any exports: any, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any require: any, module: Module, __filename: string, @@ -1059,7 +1059,7 @@ type RequireWrapper = ( function wrapSafe(filename: string, content: string): RequireWrapper { // TODO: fix this const wrapper = Module.wrap(content); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const [f, err] = (Deno as any).core.evalContext(wrapper, filename); if (err) { throw err; @@ -1108,9 +1108,9 @@ function createRequireFromPath(filename: string): RequireFunction { return makeRequireFunction(m); } -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any type Require = (id: string) => any; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any type RequireResolve = (request: string, options: any) => string; interface RequireResolveFunction extends RequireResolve { paths: (request: string) => string[] | null; @@ -1118,13 +1118,13 @@ interface RequireResolveFunction extends RequireResolve { interface RequireFunction extends Require { resolve: RequireResolveFunction; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any extensions: { [key: string]: (module: Module, filename: string) => any }; cache: { [key: string]: Module }; } function makeRequireFunction(mod: Module): RequireFunction { - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any const require = function require(path: string): any { return mod.require(path); }; diff --git a/std/node/module_test.ts b/std/node/module_test.ts index 2b3ed3eed..2faaff575 100644 --- a/std/node/module_test.ts +++ b/std/node/module_test.ts @@ -1,5 +1,4 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -/* eslint-disable @typescript-eslint/no-var-requires */ import { assert, assertEquals, diff --git a/std/node/os.ts b/std/node/os.ts index 6714f071c..773cca8bd 100644 --- a/std/node/os.ts +++ b/std/node/os.ts @@ -202,7 +202,6 @@ export function uptime(): number { /** Not yet implemented */ export function userInfo( - /* eslint-disable-next-line @typescript-eslint/no-unused-vars */ options: UserInfoOptions = { encoding: "utf-8" }, ): UserInfo { notImplemented(SEE_GITHUB_ISSUE); diff --git a/std/node/process.ts b/std/node/process.ts index 62bef922c..0a93a0928 100644 --- a/std/node/process.ts +++ b/std/node/process.ts @@ -49,12 +49,12 @@ export const process = { // TODO(JayHelton): to be implemented notImplemented(); }, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types write(_chunk: string | Uint8Array, _callback: Function): void { // TODO(JayHelton): to be implemented notImplemented(); }, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types on(_event: string, _callback: Function): void { // TODO(JayHelton): to be implemented notImplemented(); @@ -71,7 +71,7 @@ export const process = { // TODO(JayHelton): to be implemented notImplemented(); }, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types on(_event: string, _callback: Function): void { // TODO(JayHelton): to be implemented notImplemented(); @@ -88,12 +88,12 @@ export const process = { // TODO(JayHelton): to be implemented notImplemented(); }, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types write(_chunk: string | Uint8Array, _callback: Function): void { // TODO(JayHelton): to be implemented notImplemented(); }, - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types on(_event: string, _callback: Function): void { // TODO(JayHelton): to be implemented notImplemented(); @@ -104,7 +104,7 @@ export const process = { /** https://nodejs.org/api/process.html#process_process_events */ // on is not exported by node, it is only available within process: // node --input-type=module -e "import { on } from 'process'; console.log(on)" - // eslint-disable-next-line @typescript-eslint/ban-types + // deno-lint-ignore ban-types on(_event: string, _callback: Function): void { // TODO(rsp): to be implemented notImplemented(); diff --git a/std/node/querystring.ts b/std/node/querystring.ts index 35dfbbc86..321a4bab2 100644 --- a/std/node/querystring.ts +++ b/std/node/querystring.ts @@ -107,7 +107,7 @@ export function encodeStr( } export function stringify( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any obj: Record<string, any>, sep = "&", eq = "=", diff --git a/std/node/tests/cjs/cjs_a.js b/std/node/tests/cjs/cjs_a.js index 6295f3a14..b2dae2b6b 100644 --- a/std/node/tests/cjs/cjs_a.js +++ b/std/node/tests/cjs/cjs_a.js @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-undef -/* eslint-disable */ +// deno-lint-ignore-file const { helloB } = require("./cjs_b.js"); const C = require("./subdir/cjs_c"); const leftPad = require("left-pad"); diff --git a/std/node/tests/cjs/cjs_builtin.js b/std/node/tests/cjs/cjs_builtin.js index 3eae5dc59..3a971f605 100644 --- a/std/node/tests/cjs/cjs_builtin.js +++ b/std/node/tests/cjs/cjs_builtin.js @@ -1,5 +1,5 @@ // deno-lint-ignore-file no-undef -/* eslint-disable */ +// deno-lint-ignore-file const fs = require("fs"); const util = require("util"); const path = require("path"); diff --git a/std/node/timers.ts b/std/node/timers.ts index 792e37581..872e1f9ae 100644 --- a/std/node/timers.ts +++ b/std/node/timers.ts @@ -6,9 +6,9 @@ export const clearTimeout = window.clearTimeout; export const setInterval = window.setInterval; export const clearInterval = window.clearInterval; export const setImmediate = ( - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any cb: (...args: any[]) => void, - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // deno-lint-ignore no-explicit-any ...args: any[] ): number => window.setTimeout(cb, 0, ...args); export const clearImmediate = window.clearTimeout; diff --git a/std/node/util.ts b/std/node/util.ts index 076a5b830..5cab8594e 100644 --- a/std/node/util.ts +++ b/std/node/util.ts @@ -30,7 +30,7 @@ inspect.custom = Deno.customInspect; // TODO(schwarzkopfb): make it in-line with Node's implementation // Ref: https://nodejs.org/dist/latest-v14.x/docs/api/util.html#util_util_inspect_object_options -// eslint-disable-next-line @typescript-eslint/no-explicit-any +// deno-lint-ignore no-explicit-any export function inspect(object: unknown, ...opts: any): string { opts = { ...DEFAULT_INSPECT_OPTIONS, ...opts }; return Deno.inspect(object, { |