Skip to content

Commit

Permalink
styles: make eslint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jan 6, 2018
1 parent da2f761 commit f19629e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions lib/hexo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ function Hexo(base, args) {
path: pathFn.join(base, 'db.json')
});

this.config_path = args.config ? mcp(base, args.config)
: pathFn.join(base, '_config.yml');
this.config_path = args.config ? mcp(base, args.config) :
pathFn.join(base, '_config.yml');

registerModels(this);

Expand Down Expand Up @@ -224,8 +224,8 @@ Hexo.prototype.loadPlugin = function(path, callback) {
require.extensions = Module._extensions;
require.cache = Module._cache;

script = '(function(exports, require, module, __filename, __dirname, hexo){'
+ script + '});';
script = '(function(exports, require, module, __filename, __dirname, hexo){' +
script + '});';

var fn = vm.runInThisContext(script, path);

Expand Down
4 changes: 2 additions & 2 deletions lib/hexo/multi_config_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ module.exports = function(ctx) {
deepAssign(combinedConfig, yml.safeLoad(file, {json: true}));
count++;
} else {
log.w('Config file ' + paths[i]
+ ' not supported type.');
log.w('Config file ' + paths[i] +
' not supported type.');
}
}

Expand Down
12 changes: 6 additions & 6 deletions lib/plugins/helper/paginator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ function paginatorHelper(options) {

if (!current) return '';

var currentPage = '<span class="page-number current">'
+ (transform ? transform(current) : current)
+ '</span>';
var currentPage = '<span class="page-number current">' +
(transform ? transform(current) : current) +
'</span>';

function link(i) {
return self.url_for(i === 1 ? base : base + format.replace('%d', i));
}

function pageLink(i) {
return '<a class="page-number" href="' + link(i) + '">'
+ (transform ? transform(i) : i)
+ '</a>';
return '<a class="page-number" href="' + link(i) + '">' +
(transform ? transform(i) : i) +
'</a>';
}

// Display the link to the previous page
Expand Down
10 changes: 5 additions & 5 deletions lib/plugins/helper/search_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ function searchFormHelper(options) {
var text = options.hasOwnProperty('text') ? options.text : 'Search';
var button = options.button;

return '<form action="//google.com/search" method="get" accept-charset="UTF-8" class="' + className + '">'
+ '<input type="search" name="q" class="' + className + '-input"' + (text ? ' placeholder="' + text + '"' : '') + '>'
+ (button ? '<button type="submit" class="' + className + '-submit">' + (typeof button === 'string' ? button : text) + '</button>' : '')
+ '<input type="hidden" name="sitesearch" value="' + config.url + '">'
+ '</form>';
return '<form action="//google.com/search" method="get" accept-charset="UTF-8" class="' + className + '">' +
'<input type="search" name="q" class="' + className + '-input"' + (text ? ' placeholder="' + text + '"' : '') + '>' +
(button ? '<button type="submit" class="' + className + '-submit">' + (typeof button === 'string' ? button : text) + '</button>' : '') +
'<input type="hidden" name="sitesearch" value="' + config.url + '">' +
'</form>';
}

module.exports = searchFormHelper;
14 changes: 7 additions & 7 deletions lib/plugins/helper/tagcloud.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ function tagcloudHelper(tags, options) {
}

result.push(
'<a href="' + self.url_for(tag.path) + '" style="' + style + '">'
+ (transform ? transform(tag.name) : tag.name)
+ '</a>'
'<a href="' + self.url_for(tag.path) + '" style="' + style + '">' +
(transform ? transform(tag.name) : tag.name) +
'</a>'
);
});

Expand All @@ -245,10 +245,10 @@ function Color(color) {
throw new TypeError('color is required!');
}

if (this.r < 0 || this.r > 255
|| this.g < 0 || this.g > 255
|| this.b < 0 || this.b > 255
|| this.a < 0 || this.a > 1) {
if (this.r < 0 || this.r > 255 ||
this.g < 0 || this.g > 255 ||
this.b < 0 || this.b > 255 ||
this.a < 0 || this.a > 1) {
throw new Error(color + ' is invalid.');
}
}
Expand Down

0 comments on commit f19629e

Please sign in to comment.