From f291677db27bef1513de912f003cfb61156868ee Mon Sep 17 00:00:00 2001 From: Joeri van Oostveen Date: Thu, 19 Sep 2024 11:29:42 +0200 Subject: [PATCH] Fixed ESLint issues in source code --- src/bus.ts | 2 +- src/commands/init.ts | 2 +- src/dependency-injector.ts | 2 +- src/index.ts | 7 ++++--- src/taskrunner.ts | 1 + 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/bus.ts b/src/bus.ts index da552f0..2c5078d 100644 --- a/src/bus.ts +++ b/src/bus.ts @@ -27,7 +27,7 @@ export interface Bus { } export let createBus = (): Bus => { - let allSubscribers: { [index: string]: Callback[] } = {}; + let allSubscribers: Record = {}; let bus: Bus = { signal: (eventType) => { let subscribers = allSubscribers[eventType]; diff --git a/src/commands/init.ts b/src/commands/init.ts index cc563cf..92ff796 100644 --- a/src/commands/init.ts +++ b/src/commands/init.ts @@ -115,7 +115,7 @@ insert_final_newline = true`, let templateData = { library, - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports typescriptAssistantVersion: require("../../package.json").version, }; diff --git a/src/dependency-injector.ts b/src/dependency-injector.ts index efb14cf..f0f5d99 100644 --- a/src/dependency-injector.ts +++ b/src/dependency-injector.ts @@ -42,7 +42,7 @@ export let createDependencyInjector = (): (( Object.defineProperty(dependencies, "server", { get: () => { if (!server) { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports server = inject(require("./server").createServer); } return server; diff --git a/src/index.ts b/src/index.ts index 27eb53e..49333b6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -148,8 +148,8 @@ yargsModule.command( compileLimit: { describe: "Limit the number of concurrent compilations", number: true, - default: 2 - } + default: 2, + }, }, (yargs) => { inject(createCICommand) @@ -158,7 +158,7 @@ yargsModule.command( format: yargs.format, coverage: yargs.coverage, disabledProjects: yargs.disable, - compileLimit: yargs.compileLimit + compileLimit: yargs.compileLimit, }) .then(failIfUnsuccessful, onFailure); } @@ -254,4 +254,5 @@ yargsModule.command( } ); +// eslint-disable-next-line @typescript-eslint/no-unused-expressions yargsModule.strict().argv; diff --git a/src/taskrunner.ts b/src/taskrunner.ts index dba3506..80f4c37 100644 --- a/src/taskrunner.ts +++ b/src/taskrunner.ts @@ -90,6 +90,7 @@ export function createDefaultTaskRunner(): TaskRunner { if (code === 0 || code === null) { resolve(); } else { + // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors reject(`Process exited with code ${code}`); } });