Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Update to es6+.
Browse files Browse the repository at this point in the history
Remove support for node 8.

Update dependencies.

Update eslint config.
  • Loading branch information
jonkemp committed Jan 19, 2020
1 parent f1a7218 commit 38cd7b3
Show file tree
Hide file tree
Showing 7 changed files with 1,581 additions and 828 deletions.
26 changes: 16 additions & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@
},
"globals": {},
"extends": "eslint:recommended",

// Stop ESLint from looking for a configuration file in parent folders
"root": true,

"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "script",
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
},
"rules": {
"block-scoped-var": 2,
"complexity": [
Expand Down Expand Up @@ -42,11 +54,6 @@
"never"
],

"strict": [
2,
"global"
],

"no-shadow": 2,
"no-use-before-define": 2,

Expand Down Expand Up @@ -124,14 +131,14 @@
],
"new-cap": 2,
"new-parens": 2,
"newline-after-var": [
1,
"always"
"padding-line-between-statements": [
"error",
{ "blankLine": "always", "prev": ["const", "let", "var"], "next": "*"},
{ "blankLine": "any", "prev": ["const", "let", "var"], "next": ["const", "let", "var"]}
],
"no-array-constructor": 2,
"no-bitwise": 1,
"no-lonely-if": 1,
"no-multi-spaces": 1,
"no-multiple-empty-lines": 1,
"no-new-object": 2,
"no-spaced-func": 1,
Expand All @@ -141,7 +148,6 @@
1,
"always"
],
"one-var": 1,
"operator-assignment": [
1,
"always"
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: node_js
node_js:
- '12'
- '10'
- '8'
before_script:
- npm install -g gulp
- gulp lint
Expand Down
30 changes: 13 additions & 17 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,19 @@
'use strict';
var gulp = require('gulp'),
eslint = require('gulp-eslint'),
mocha = require('gulp-mocha'),
paths = {
scripts: ['./*.js', '!./gulpfile.js']
};
const gulp = require('gulp');
const eslint = require('gulp-eslint');
const mocha = require('gulp-mocha');

gulp.task('lint', function () {
return gulp.src(paths.scripts)
.pipe(eslint())
.pipe(eslint.format());
});
const paths = {
scripts: ['./*.js', '!./gulpfile.js']
};

gulp.task('test', function () {
return gulp.src('./test/*.js')
.pipe(mocha());
});
gulp.task('lint', () => gulp.src(paths.scripts)
.pipe(eslint({fix: true}))
.pipe(eslint.format()));

gulp.task('test', () => gulp.src('./test/*.js')
.pipe(mocha()));

gulp.task('watch', function () {
gulp.task('watch', () => {
gulp.watch(paths.scripts, gulp.parallel('lint', 'test'));
});

Expand Down
16 changes: 7 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
'use strict';
const url = require('url');
const fs = require('fs');
const getRemoteContent = require('remote-content');

var url = require('url'),
fs = require('fs'),
getRemoteContent = require('remote-content');

module.exports = function (destHref, sourceHref, callback) {
var resolvedUrl,
parsedUrl,
toUrl = destHref;
module.exports = (destHref, sourceHref, callback) => {
let resolvedUrl;
let parsedUrl;
let toUrl = destHref;

if (url.parse(sourceHref).protocol === 'file:' && destHref[0] === '/') {
toUrl = destHref.slice(1);
Expand Down

0 comments on commit 38cd7b3

Please sign in to comment.