From be3226ce471c7eeebb2e6c2964a57a5168a86808 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 5 Sep 2021 14:32:04 +0900 Subject: [PATCH] wip --- .eslintrc.js | 2 ++ package.json | 2 +- src/misc/cafy-id.ts | 1 + src/prelude/url.ts | 2 +- src/queue/processors/object-storage/clean-remote-files.ts | 3 ++- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index eb674c08a..a16cc90f6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -34,6 +34,8 @@ module.exports = { 'no-constant-condition': ['warn'], 'no-empty-pattern': ['warn'], 'no-async-promise-executor': ['off'], + 'no-useless-escape': ['off'], + 'no-multi-spaces': ['warn'], '@typescript-eslint/no-inferrable-types': ['warn'], '@typescript-eslint/no-empty-function': ['off'], '@typescript-eslint/no-non-null-assertion': ['off'], diff --git a/package.json b/package.json index c5796b7da..7335f3569 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "watch-gulp": "gulp watch", "clean": "gulp clean", "cleanall": "gulp cleanall", - "lint": "eslint src/**/*.ts", + "lint": "eslint --quiet src/**/*.ts", "cy:open": "cypress open", "cy:run": "cypress run", "e2e": "start-server-and-test start:test http://localhost cy:run", diff --git a/src/misc/cafy-id.ts b/src/misc/cafy-id.ts index 39886611e..dd81c5c4c 100644 --- a/src/misc/cafy-id.ts +++ b/src/misc/cafy-id.ts @@ -1,5 +1,6 @@ import { Context } from 'cafy'; +// eslint-disable-next-line @typescript-eslint/ban-types export class ID extends Context { public readonly name = 'ID'; diff --git a/src/prelude/url.ts b/src/prelude/url.ts index a3613fc9b..774b7095f 100644 --- a/src/prelude/url.ts +++ b/src/prelude/url.ts @@ -1,6 +1,6 @@ import { stringify } from 'querystring'; -export function query(obj: {}): string { +export function query(obj: Record): string { return stringify(Object.entries(obj) .filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined) .reduce((a, [k, v]) => (a[k] = v, a), {} as Record)); diff --git a/src/queue/processors/object-storage/clean-remote-files.ts b/src/queue/processors/object-storage/clean-remote-files.ts index 3b2e4ea93..f534489af 100644 --- a/src/queue/processors/object-storage/clean-remote-files.ts +++ b/src/queue/processors/object-storage/clean-remote-files.ts @@ -7,7 +7,8 @@ import { MoreThan, Not, IsNull } from 'typeorm'; const logger = queueLogger.createSubLogger('clean-remote-files'); -export default async function cleanRemoteFiles(job: Bull.Job<{}>, done: any): Promise { +// eslint-disable-next-line import/no-default-export +export default async function cleanRemoteFiles(job: Bull.Job>, done: () => void): Promise { logger.info(`Deleting cached remote files...`); let deletedCount = 0;