Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump Eslint & drop nodejs 6 #61

Merged
merged 6 commits into from Jul 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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