diff --git a/lib/hexo/index.ts b/lib/hexo/index.ts index f1d11e99d4..023f78f81d 100644 --- a/lib/hexo/index.ts +++ b/lib/hexo/index.ts @@ -122,7 +122,7 @@ declare module 'module' { function _nodeModulePaths(path: string): string[]; function _resolveFilename(request: string, parent: Module, isMain?: any, options?: any): string; const _extensions: NodeJS.RequireExtensions, - _cache: any; + _cache: any; } class Hexo extends EventEmitter { @@ -325,6 +325,7 @@ class Hexo extends EventEmitter { const c = this.extend.console.get(name); + // eslint-disable-next-line no-extra-parens if (c) return (Reflect.apply(c, this, [args]) as any).asCallback(callback); return Promise.reject(new Error(`Console \`${name}\` has not been registered yet!`)); } diff --git a/lib/models/types/moment.ts b/lib/models/types/moment.ts index c8402806d5..59a86e1479 100644 --- a/lib/models/types/moment.ts +++ b/lib/models/types/moment.ts @@ -4,6 +4,7 @@ import { moment, toMomentLocale } from '../../plugins/helper/date'; declare module 'moment' { export default interface Moment extends moment.Moment { _d: Date; + // eslint-disable-next-line semi } } diff --git a/lib/plugins/console/deploy.ts b/lib/plugins/console/deploy.ts index c6483790d0..6da32c2e76 100644 --- a/lib/plugins/console/deploy.ts +++ b/lib/plugins/console/deploy.ts @@ -48,6 +48,7 @@ function deployConsole(args) { this.log.info('Deploying: %s', magenta(type)); + // eslint-disable-next-line no-extra-parens return (Reflect.apply(deployers[type], this, [{ ...item, ...args }]) as any).then(() => { this.log.info('Deploy done: %s', magenta(type)); }); diff --git a/lib/plugins/generator/asset.ts b/lib/plugins/generator/asset.ts index eed0951814..b7dcb47a83 100644 --- a/lib/plugins/generator/asset.ts +++ b/lib/plugins/generator/asset.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/ban-ts-comment */ import { exists, createReadStream } from 'hexo-fs'; import Promise from 'bluebird'; import { extname } from 'path'; diff --git a/lib/theme/view.ts b/lib/theme/view.ts index 241005f871..f2b2234d4f 100644 --- a/lib/theme/view.ts +++ b/lib/theme/view.ts @@ -40,12 +40,14 @@ class View { this._precompile(); } + // eslint-disable-next-line @typescript-eslint/ban-types render(options: Options | Function = {}, callback) { if (!callback && typeof options === 'function') { callback = options; options = {}; } const { data } = this; + // eslint-disable-next-line no-extra-parens const { layout = (options as Options).layout } = data; const locals = this._buildLocals(options); diff --git a/test/benchmark.js b/test/benchmark.js index 148fd5d71e..e377b140b6 100644 --- a/test/benchmark.js +++ b/test/benchmark.js @@ -5,7 +5,7 @@ const { spawn } = require('child_process'); const { spawn: spawnAsync } = require('hexo-util'); const { rmdir, exists } = require('hexo-fs'); const { appendFileSync: appendFile } = require('fs'); -const { join, resolve } = require('path'); +const { resolve } = require('path'); const log = require('hexo-log').default(); const { red } = require('picocolors'); const hooks = [