Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Mar 11, 2023
1 parent a7d0eb6 commit 2749b23
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/hexo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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!`));
}
Expand Down
1 change: 1 addition & 0 deletions lib/models/types/moment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/plugins/console/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
Expand Down
1 change: 1 addition & 0 deletions lib/plugins/generator/asset.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 2 additions & 0 deletions lib/theme/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion test/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 2749b23

Please sign in to comment.