Skip to content

Commit ecd7ffa

Browse files
committedFeb 11, 2017
ES2015ify
1 parent 018cd95 commit ecd7ffa

28 files changed

+625
-780
lines changed
 

‎.eslintrc

-137
This file was deleted.

‎gulpfile.js

+21-33
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,41 @@
11
'use strict';
2-
var path = require('path');
3-
var gulp = require('gulp');
4-
var eslint = require('gulp-eslint');
5-
var excludeGitignore = require('gulp-exclude-gitignore');
6-
var mocha = require('gulp-mocha');
7-
var istanbul = require('gulp-istanbul');
8-
var nsp = require('gulp-nsp');
9-
var plumber = require('gulp-plumber');
10-
var coveralls = require('gulp-coveralls');
11-
12-
gulp.task('static', function () {
13-
return gulp.src('**/*.js')
14-
.pipe(excludeGitignore())
15-
.pipe(eslint())
16-
.pipe(eslint.format())
17-
.pipe(eslint.failAfterError());
18-
});
19-
20-
gulp.task('nsp', function (cb) {
2+
const path = require('path');
3+
const gulp = require('gulp');
4+
const mocha = require('gulp-mocha');
5+
const istanbul = require('gulp-istanbul');
6+
const nsp = require('gulp-nsp');
7+
const plumber = require('gulp-plumber');
8+
const coveralls = require('gulp-coveralls');
9+
10+
gulp.task('nsp', cb => {
2111
nsp({package: path.resolve('package.json')}, cb);
2212
});
2313

24-
gulp.task('pre-test', function () {
25-
return gulp.src('lib/**/*.js')
26-
.pipe(istanbul({
27-
includeUntested: true
28-
}))
29-
.pipe(istanbul.hookRequire());
30-
});
14+
gulp.task('pre-test', () =>
15+
gulp.src('lib/**/*.js')
16+
.pipe(istanbul({includeUntested: true}))
17+
.pipe(istanbul.hookRequire())
18+
);
3119

32-
gulp.task('test', ['pre-test'], function (cb) {
33-
var mochaErr;
20+
gulp.task('test', ['pre-test'], cb => {
21+
let mochaErr;
3422

35-
// will disable cache for completion tests
23+
// Will disable cache for completion tests
3624
process.env.YO_TEST = 1;
3725

3826
gulp.src('test/**/*.js')
3927
.pipe(plumber())
4028
.pipe(mocha({reporter: 'spec'}))
41-
.on('error', function (err) {
29+
.on('error', err => {
4230
mochaErr = err;
4331
})
4432
.pipe(istanbul.writeReports())
45-
.on('end', function () {
33+
.on('end', () => {
4634
cb(mochaErr);
4735
});
4836
});
4937

50-
gulp.task('coveralls', ['test'], function () {
38+
gulp.task('coveralls', ['test'], () => {
5139
if (!process.env.CI) {
5240
return;
5341
}
@@ -57,4 +45,4 @@ gulp.task('coveralls', ['test'], function () {
5745
});
5846

5947
gulp.task('prepublish', ['nsp']);
60-
gulp.task('default', ['static', 'test', 'coveralls']);
48+
gulp.task('default', ['test', 'coveralls']);

0 commit comments

Comments
 (0)
Please sign in to comment.