Fixed linting issues with index.js
This commit is contained in:
parent
3928f02b01
commit
ae3fa21a3a
19
index.js
19
index.js
|
@ -1,14 +1,19 @@
|
||||||
var gutil = require("gulp-util");
|
var gutil = require('gulp-util');
|
||||||
var through = require("through2");
|
var through = require('through2');
|
||||||
var assign = require("object-assign");
|
var assign = require('object-assign');
|
||||||
var path = require('path');
|
var path = require('path');
|
||||||
var sass = require("node-sass");
|
var sass = require('node-sass');
|
||||||
var applySourceMap = require('vinyl-sourcemaps-apply');
|
var applySourceMap = require('vinyl-sourcemaps-apply');
|
||||||
|
|
||||||
var PLUGIN_NAME = 'gulp-sass';
|
var PLUGIN_NAME = 'gulp-sass';
|
||||||
|
|
||||||
module.exports = function(options) {
|
module.exports = function(options) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
return through.obj(function(file, enc, cb) {
|
return through.obj(function(file, enc, cb) {
|
||||||
|
var opts,
|
||||||
|
callback;
|
||||||
|
|
||||||
if (file.isNull()) {
|
if (file.isNull()) {
|
||||||
return cb(null, file);
|
return cb(null, file);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +24,7 @@ module.exports = function(options) {
|
||||||
return cb();
|
return cb();
|
||||||
}
|
}
|
||||||
|
|
||||||
var opts = assign({}, options);
|
opts = assign({}, options);
|
||||||
opts.file = file.path;
|
opts.file = file.path;
|
||||||
|
|
||||||
// Generate Source Maps if plugin source-map present
|
// Generate Source Maps if plugin source-map present
|
||||||
|
@ -28,7 +33,7 @@ module.exports = function(options) {
|
||||||
opts.omitSourceMapUrl = true;
|
opts.omitSourceMapUrl = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var callback = function(error, obj) {
|
callback = function(error, obj) {
|
||||||
if (error) {
|
if (error) {
|
||||||
return cb(new gutil.PluginError(
|
return cb(new gutil.PluginError(
|
||||||
PLUGIN_NAME, error.message + ' on line ' + error.line + ' in ' + error.file
|
PLUGIN_NAME, error.message + ' on line ' + error.line + ' in ' + error.file
|
||||||
|
|
Loading…
Reference in a new issue