diff --git a/config.js b/config.js index b9a6158..d3b74c2 100644 --- a/config.js +++ b/config.js @@ -26,6 +26,6 @@ module.exports = { lintRoots: ['lib', 'src', 'spec'], browserify: { debug: true, - fullPaths: false, + fullPaths: false } }; diff --git a/gulpfile.js b/gulpfile.js index a3a0752..6836ca9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -120,12 +120,11 @@ gulp.task('scripts', function() { sourcemaps = require('gulp-sourcemaps'), rename = require('gulp-rename'); - var b = browserify(config.browserify) + return browserify(config.browserify) .transform(require('./lib/canopy-transform')) .transform(require('babelify')) - .add('./src/js/main.js'); - - return b.bundle() + .add('./src/js/main.js') + .bundle() .on('error', notify.onError()) .pipe(source('./src/js/main.js')) .pipe(buffer()) diff --git a/lib/canopy-transform.js b/lib/canopy-transform.js index f475022..2fe7ef3 100644 --- a/lib/canopy-transform.js +++ b/lib/canopy-transform.js @@ -2,12 +2,12 @@ var through = require('through'), canopy = require('canopy'); module.exports = function(file) { + var data = ''; + if (!/\.peg$/.test(file)) { return through(); } - var data = ''; - return through( function(buf) { data += buf; diff --git a/spec/parser/javascript/match_spec.js b/spec/parser/javascript/match_spec.js index a8c8e75..c914288 100644 --- a/spec/parser/javascript/match_spec.js +++ b/spec/parser/javascript/match_spec.js @@ -25,7 +25,7 @@ describe('parser/javascript/match.js', function() { jasmine.objectContaining({ content: jasmine.objectContaining({ literal: 'example' }) }) - ], + ] }, 'example$': { anchorStart: false, diff --git a/spec/parser/javascript/node_spec.js b/spec/parser/javascript/node_spec.js index de378fa..99bdb06 100644 --- a/spec/parser/javascript/node_spec.js +++ b/spec/parser/javascript/node_spec.js @@ -30,7 +30,9 @@ describe('parser/javascript/node.js', function() { this.node.module = { definedProperties: { example: { - get: function() { return 'value'; } + get: function() { + return 'value'; + } } } }; @@ -77,28 +79,28 @@ describe('parser/javascript/node.js', function() { describe('#getBBox', function() { it('returns the normalized bbox of the container merged with the anchor', function() { - this.node.proxy = { - anchor: { - anchor: 'example anchor' - } - }; - this.node.container = jasmine.createSpyObj('container', ['addClass', 'getBBox']); - this.node.container.getBBox.and.returnValue({ - bbox: 'example bbox', - x: 'left', - x2: 'right', - cy: 'center' - }); - expect(this.node.getBBox()).toEqual({ - bbox: 'example bbox', - anchor: 'example anchor', - x: 'left', - x2: 'right', - cy: 'center', - ax: 'left', - ax2: 'right', - ay: 'center' - }); + this.node.proxy = { + anchor: { + anchor: 'example anchor' + } + }; + this.node.container = jasmine.createSpyObj('container', ['addClass', 'getBBox']); + this.node.container.getBBox.and.returnValue({ + bbox: 'example bbox', + x: 'left', + x2: 'right', + cy: 'center' + }); + expect(this.node.getBBox()).toEqual({ + bbox: 'example bbox', + anchor: 'example anchor', + x: 'left', + x2: 'right', + cy: 'center', + ax: 'left', + ax2: 'right', + ay: 'center' + }); }); }); diff --git a/spec/parser/javascript_spec.js b/spec/parser/javascript_spec.js index ce18a7b..b7a43aa 100644 --- a/spec/parser/javascript_spec.js +++ b/spec/parser/javascript_spec.js @@ -123,7 +123,7 @@ describe('parser/javascript.js', function() { it('sets the dimensions of the image', function(done) { this.parser.render() .then(() => { - var svg = this.container.querySelector('svg'); + let svg = this.container.querySelector('svg'); expect(svg.getAttribute('width')).toEqual('62'); expect(svg.getAttribute('height')).toEqual('44'); diff --git a/spec/regexper_spec.js b/spec/regexper_spec.js index 9edbb47..cc4e985 100644 --- a/spec/regexper_spec.js +++ b/spec/regexper_spec.js @@ -17,7 +17,7 @@ describe('regexper.js', function() { '', '
', '