diff --git a/lib/extend/tag.js b/lib/extend/tag.js index df66add124..ba8efef76e 100644 --- a/lib/extend/tag.js +++ b/lib/extend/tag.js @@ -69,7 +69,7 @@ function getContext(lines, errLine, location, type) { Array.prototype.push.apply(message, // get LINES_OF_CONTEXT lines surrounding `errLine` getContextLineNums(1, lines.length, errLine, LINES_OF_CONTEXT) - .map(function(lnNum) { + .map(lnNum => { const line = ' ' + lnNum + ' | ' + lines[lnNum - 1]; if (lnNum === errLine) { return colorize.bold(line); diff --git a/lib/plugins/tag/code.js b/lib/plugins/tag/code.js index e7cfd8a614..69700a1c60 100644 --- a/lib/plugins/tag/code.js +++ b/lib/plugins/tag/code.js @@ -52,7 +52,7 @@ function getHighlightOptions(config, arg) { let mark = []; if (rMark.test(arg)) { arg = arg.replace(rMark, (match, _mark) => { - mark = _mark.split(',').reduce(function getMarkedLines(prev, cur) { + mark = _mark.split(',').reduce((prev, cur) => { if (/-/.test(cur)) { let a = Number(cur.substr(0, cur.indexOf('-'))); let b = Number(cur.substr(cur.indexOf('-') + 1)); diff --git a/test/scripts/console/list_categories.js b/test/scripts/console/list_categories.js index 822bc312a1..1519533356 100644 --- a/test/scripts/console/list_categories.js +++ b/test/scripts/console/list_categories.js @@ -13,7 +13,7 @@ describe('Console list', () => { before(() => { const log = console.log; - sinon.stub(console, 'log').callsFake(function(...args) { + sinon.stub(console, 'log').callsFake((...args) => { return log.apply(log, args); }); }); diff --git a/test/scripts/console/list_page.js b/test/scripts/console/list_page.js index d4f2afd1c5..96cd89a26d 100644 --- a/test/scripts/console/list_page.js +++ b/test/scripts/console/list_page.js @@ -12,7 +12,7 @@ describe('Console list', () => { hexo.config.permalink = ':title/'; before(() => { const log = console.log; - sinon.stub(console, 'log').callsFake(function(...args) { + sinon.stub(console, 'log').callsFake((...args) => { return log.apply(log, args); }); }); diff --git a/test/scripts/console/list_post.js b/test/scripts/console/list_post.js index 96f424fdfb..6509e3751e 100644 --- a/test/scripts/console/list_post.js +++ b/test/scripts/console/list_post.js @@ -12,7 +12,7 @@ describe('Console list', () => { before(() => { const log = console.log; - sinon.stub(console, 'log').callsFake(function(...args) { + sinon.stub(console, 'log').callsFake((...args) => { return log.apply(log, args); }); }); diff --git a/test/scripts/console/list_tags.js b/test/scripts/console/list_tags.js index 50b38419f1..0b9d9247df 100644 --- a/test/scripts/console/list_tags.js +++ b/test/scripts/console/list_tags.js @@ -14,7 +14,7 @@ describe('Console list', () => { hexo.config.permalink = ':title/'; before(() => { const log = console.log; - sinon.stub(console, 'log').callsFake(function(...args) { + sinon.stub(console, 'log').callsFake((...args) => { return log.apply(log, args); }); });