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

Drop dependency on deprecated gulp-util #121

Merged
merged 1 commit into from
Dec 31, 2017
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';
var path = require('path');
var gutil = require('gulp-util');
var PluginError = require('plugin-error');
var through = require('through2');
var tildify = require('tildify');
var Checker = require('jscs');
Expand Down Expand Up @@ -41,7 +41,7 @@ module.exports = function (opts) {
}

if (file.isStream()) {
cb(new gutil.PluginError('gulp-jscs', 'Streaming not supported'));
cb(new PluginError('gulp-jscs', 'Streaming not supported'));
return;
}

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@
"checker"
],
"dependencies": {
"gulp-util": "^3.0.4",
"jscs": "^3.0.4",
"plugin-error": "^0.1.2",
"through2": "^2.0.0",
"tildify": "^1.0.0"
},
"devDependencies": {
"mocha": "*",
"stream-assert": "^2.0.2",
"temp-write": "^2.1.0",
"vinyl": "^2.1.0",
"xo": "*"
}
}
2 changes: 1 addition & 1 deletion reporters/fail.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
var PluginError = require('gulp-util').PluginError;
var PluginError = require('plugin-error');
var through = require('through2');

module.exports = function (failImmediately) {
Expand Down
2 changes: 1 addition & 1 deletion reporters/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';
var PluginError = require('gulp-util').PluginError;
var PluginError = require('plugin-error');
var through = require('through2');
var loadReporter = require('./load-reporter');
var failReporter = require('./fail');
Expand Down
34 changes: 17 additions & 17 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'use strict';
var path = require('path');
var assert = require('assert');
var gutil = require('gulp-util');
var Vinyl = require('vinyl');
var streamAssert = require('stream-assert');
var tempWrite = require('temp-write');
var jscs = require('./');
Expand Down Expand Up @@ -38,13 +38,13 @@ it('should check code style of JS files', function (cb) {
}))
.pipe(streamAssert.end(cb));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1,y = 2;')
}));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture2.js'),
contents: new Buffer('var x = { a: 1 };')
Expand All @@ -65,7 +65,7 @@ it('should check code style of JS files using a preset', function (cb) {
}))
.pipe(streamAssert.end(cb));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1,y = 2;')
Expand All @@ -81,7 +81,7 @@ it('should pass valid files', function (cb) {
assert(false, err);
}).on('end', cb).resume();

stream.write(new gutil.File({
stream.write(new Vinyl({
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1; var y = 2;')
}));
Expand All @@ -96,7 +96,7 @@ it('should respect "excludeFiles" from config', function (cb) {
assert(false, err);
}).on('end', cb).resume();

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'excluded.js'),
contents: new Buffer('var x = { a: 1 };')
Expand All @@ -118,7 +118,7 @@ it('should accept configPath options', function (cb) {
}))
.pipe(streamAssert.end(cb));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('import x from \'x\'; var x = 1, y = 2;')
Expand All @@ -138,7 +138,7 @@ it('should accept the fix option', function (cb) {

stream.on('end', cb);

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = { a: 1, b: 2 }')
Expand Down Expand Up @@ -169,13 +169,13 @@ it('should run autofix over as many errors as possible', function (done) {
}))
.pipe(streamAssert.end(done));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer(invalidJS)
}));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture2.js'),
contents: new Buffer(invalidJS)
Expand All @@ -201,7 +201,7 @@ describe('Reporter', function () {
cb();
}).resume();

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1,y = 2;')
Expand All @@ -220,7 +220,7 @@ describe('Reporter', function () {
cb();
}).resume();

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1,y = 2;')
Expand All @@ -239,7 +239,7 @@ describe('Reporter', function () {

stream.pipe(jscs.reporter(reporterFn)).resume();

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1,y = 2;')
Expand Down Expand Up @@ -276,13 +276,13 @@ describe('Reporter', function () {
cb();
}));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1,y = 2;')
}));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'passing.js'),
contents: new Buffer('var x = 1; var y = 2;')
Expand All @@ -305,13 +305,13 @@ describe('Reporter', function () {
}))
.pipe(streamAssert.end());

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'fixture.js'),
contents: new Buffer('var x = 1,y = 2;')
}));

stream.write(new gutil.File({
stream.write(new Vinyl({
base: __dirname,
path: path.join(__dirname, 'passing.js'),
contents: new Buffer('var x = 1; var y = 2;')
Expand Down