From 28e185dc286a050ee3824a54b9f58d881bddf267 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2019 05:30:25 +0000 Subject: [PATCH 1/6] Update eslint requirement from ^5.9.0 to ^6.0.1 Updates the requirements on [eslint](https://github.com/eslint/eslint) to permit the latest version. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v5.9.0...v6.0.1) Signed-off-by: dependabot-preview[bot] --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 12a4c108..cb4629fb 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "license": "MIT", "devDependencies": { "chai": "^4.2.0", - "eslint": "^5.9.0", + "eslint": "^6.0.1", "eslint-config-hexo": "^3.0.0", "html-tag-validator": "^1.5.0", "istanbul": "^0.4.3", From 97f599f4f7faa3606d5bac18e6da5a43e73f6f47 Mon Sep 17 00:00:00 2001 From: Thomas Piart Date: Tue, 25 Jun 2019 20:16:52 +0200 Subject: [PATCH 2/6] bump eslint & drop nodejs 6 --- .travis.yml | 6 ++---- package.json | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 52672917..bbabbb5c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,11 @@ cache: - node_modules node_js: - - "6" + - "8" + - "10" - "node" script: - # For older versions of npm (ie. the one bundled with Node 6), we need to manually run `prepare` - # to build the project. You can still install and consume the package without any issue. - - if [[ "$TRAVIS_NODE_VERSION" == "6" ]]; then npm run prepare; fi - npm run eslint - npm run test-cov diff --git a/package.json b/package.json index cb4629fb..fd64e95e 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,7 @@ "scripts": { "eslint": "eslint .", "test": "mocha test/index.js", - "test-cov": "istanbul cover --print both _mocha -- test/index.js", - "build:highlight": "node scripts/build_highlight_alias.js > highlight_alias.json", - "prepare": "npm run build:highlight" + "test-cov": "istanbul cover --print both _mocha -- test/index.js" }, "directories": { "lib": "./lib" @@ -43,6 +41,6 @@ "striptags": "^3.1.1" }, "engines": { - "node": ">=6.9.0" + "node": ">=8.6.0" } } From f8a4e2241fe441bd24f9f7b0a2d1388fcde6a598 Mon Sep 17 00:00:00 2001 From: Thomas Piart Date: Tue, 25 Jun 2019 20:21:51 +0200 Subject: [PATCH 3/6] fix build --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index fd64e95e..941091aa 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "scripts": { "eslint": "eslint .", "test": "mocha test/index.js", - "test-cov": "istanbul cover --print both _mocha -- test/index.js" + "test-cov": "istanbul cover --print both _mocha -- test/index.js", + "build:highlight": "node scripts/build_highlight_alias.js > highlight_alias.json", + "prepare": "npm run build:highlight" }, "directories": { "lib": "./lib" From bd2647d108265307f6297bef49a579ab0d44cb2e Mon Sep 17 00:00:00 2001 From: Thomas Piart Date: Wed, 10 Jul 2019 09:36:06 +0200 Subject: [PATCH 4/6] fix eslint --- lib/highlight.js | 2 +- lib/permalink.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/highlight.js b/lib/highlight.js index 42fa2aa9..298b405a 100644 --- a/lib/highlight.js +++ b/lib/highlight.js @@ -8,7 +8,7 @@ const alias = require('../highlight_alias.json'); function highlightUtil(str, options = {}) { if (typeof str !== 'string') throw new TypeError('str must be a string!'); - const useHljs = options.hasOwnProperty('hljs') ? options.hljs : false; + const useHljs = Object.prototype.hasOwnProperty.call(options, 'hljs') ? options.hljs : false; const { gutter = true, firstLine = 1, diff --git a/lib/permalink.js b/lib/permalink.js index d574866e..4e31353e 100644 --- a/lib/permalink.js +++ b/lib/permalink.js @@ -15,7 +15,7 @@ function Permalink(rule, options) { .replace(rParam, (match, name) => { params.push(name); - if (segments.hasOwnProperty(name)) { + if (Object.prototype.hasOwnProperty.call(segments, name)) { const segment = segments[name]; if (segment instanceof RegExp) { From d39bf29bdf50af61c0835e8292e2a68bc59eb484 Mon Sep 17 00:00:00 2001 From: Thomas Piart Date: Sun, 28 Jul 2019 09:03:03 +0200 Subject: [PATCH 5/6] fix tests? --- test/scripts/spawn.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/scripts/spawn.js b/test/scripts/spawn.js index 23fe3c64..0eb33391 100644 --- a/test/scripts/spawn.js +++ b/test/scripts/spawn.js @@ -44,7 +44,9 @@ describe('spawn', () => { spawn.__set__('process', { stdout: stdoutCache, - stderr: stderrCache + stderr: stderrCache, + removeListener: () => {}, + on: () => {} }); return spawn('echo', [content], { @@ -61,7 +63,9 @@ describe('spawn', () => { spawn.__set__('process', { stdout: stdoutCache, - stderr: stderrCache + stderr: stderrCache, + removeListener: () => {}, + on: () => {} }); return spawn('cat', ['nothing'], { From 13ae1191f46e4199d7b109ba0690b9106170b3ad Mon Sep 17 00:00:00 2001 From: Thomas Piart Date: Sun, 28 Jul 2019 09:20:52 +0200 Subject: [PATCH 6/6] testing fixes --- test/scripts/spawn.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/scripts/spawn.js b/test/scripts/spawn.js index 0eb33391..f215c3db 100644 --- a/test/scripts/spawn.js +++ b/test/scripts/spawn.js @@ -46,7 +46,8 @@ describe('spawn', () => { stdout: stdoutCache, stderr: stderrCache, removeListener: () => {}, - on: () => {} + on: () => {}, + exit: () => {} }); return spawn('echo', [content], { @@ -65,7 +66,8 @@ describe('spawn', () => { stdout: stdoutCache, stderr: stderrCache, removeListener: () => {}, - on: () => {} + on: () => {}, + exit: () => {} }); return spawn('cat', ['nothing'], {