Skip to content

Commit 44110fd

Browse files
author
Asgeir Hølleland
committedFeb 14, 2018
No longer using the deprecate package gulp-util, closes #34
1 parent 8de7f79 commit 44110fd

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed
 

‎index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
var gutil = require('gulp-util');
2+
var PluginError = require('plugin-error');
33
var through = require('through2');
44
var stylint = require('stylint');
55

@@ -10,7 +10,7 @@ var failReporter = function (options) {
1010

1111
return through.obj(function (file, enc, cb) {
1212
if (file.stylint && (file.stylint.errors || (failOnWarning && file.stylint.warnings))) {
13-
return cb(new gutil.PluginError('gulp-stylint', 'Stylint failed for ' + file.relative), file);
13+
return cb(new PluginError('gulp-stylint', 'Stylint failed for ' + file.relative), file);
1414
}
1515

1616
this.push(file);
@@ -42,7 +42,7 @@ module.exports = function (options) {
4242
}
4343

4444
if (file.isStream()) {
45-
return cb(gutil.PluginError('gulp-stylint', 'Streaming not supported'), file);
45+
return cb(new PluginError('gulp-stylint', 'Streaming not supported'), file);
4646
}
4747

4848
stylint(file.path, rules)
@@ -87,7 +87,7 @@ module.exports.reporter = function (reporter, options) {
8787
return failReporter(options);
8888
}
8989

90-
throw new gutil.PluginError('gulp-stylint', reporter + ' is not a reporter');
90+
throw new PluginError('gulp-stylint', reporter + ' is not a reporter');
9191
}
9292

9393
var logger = (reporter || {}).logger || console.log;

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@
2626
"stylus"
2727
],
2828
"dependencies": {
29-
"gulp-util": "^3.0.7",
29+
"plugin-error": "^1.0.1",
3030
"stylint": "1.4.1",
31-
"through2": "^2.0.1"
31+
"through2": "^2.0.1",
32+
"vinyl": "^2.1.0"
3233
},
3334
"devDependencies": {
3435
"chalk": "^1.1.3",

‎test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
var assert = require('assert');
66
var fs = require('fs');
77
var path = require('path');
8-
var gutil = require('gulp-util');
8+
var Vinyl = require('vinyl');
99
var sinon = require('sinon');
1010
var chalk = require('chalk');
1111
var stylint = require('./');
@@ -17,7 +17,7 @@ function file(filenames) {
1717
files.forEach(function (filename) {
1818
var pathToFile = path.resolve('fixtures', filename);
1919

20-
stream.write(new gutil.File({
20+
stream.write(new Vinyl({
2121
path: pathToFile,
2222
contents: fs.readFileSync(pathToFile)
2323
}));

0 commit comments

Comments
 (0)
Please sign in to comment.