Skip to content

Commit

Permalink
Bump Eslint & drop nodejs 6 (#61)
Browse files Browse the repository at this point in the history
chore: Update eslint requirement from ^5.9.0 to ^6.0.1
  • Loading branch information
tomap authored and curbengh committed Jul 28, 2019
1 parent ecd8a18 commit 3d9e404
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion lib/highlight.js
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion lib/permalink.js
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -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",
Expand All @@ -43,6 +43,6 @@
"striptags": "^3.1.1"
},
"engines": {
"node": ">=6.9.0"
"node": ">=8.6.0"
}
}
10 changes: 8 additions & 2 deletions test/scripts/spawn.js
Expand Up @@ -44,7 +44,10 @@ describe('spawn', () => {

spawn.__set__('process', {
stdout: stdoutCache,
stderr: stderrCache
stderr: stderrCache,
removeListener: () => {},
on: () => {},
exit: () => {}
});

return spawn('echo', [content], {
Expand All @@ -61,7 +64,10 @@ describe('spawn', () => {

spawn.__set__('process', {
stdout: stdoutCache,
stderr: stderrCache
stderr: stderrCache,
removeListener: () => {},
on: () => {},
exit: () => {}
});

return spawn('cat', ['nothing'], {
Expand Down

0 comments on commit 3d9e404

Please sign in to comment.