From 2879bd4c228d0fd7b9342cba678e89a14e9fc803 Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 9 Feb 2021 12:55:32 -0600 Subject: [PATCH] Add type alias for required modules --- src/node/plugin.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/node/plugin.ts b/src/node/plugin.ts index 07998100..d0531610 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -12,13 +12,15 @@ import * as util from "./util" import { Router as WsRouter, WebsocketRouter, wss } from "./wsRouter" const fsp = fs.promises +// Represents a required module which could be anything. +type Module = any + /** * Inject code-server when `require`d. This is required because the API provides * more than just types so these need to be provided at run-time. */ const originalLoad = require("module")._load -// eslint-disable-next-line @typescript-eslint/no-explicit-any -require("module")._load = function (request: string, parent: object, isMain: boolean): any { +require("module")._load = function (request: string, parent: object, isMain: boolean): Module { if (request === "code-server") { return { express,