Fixing lint errors
This commit is contained in:
parent
e35be731cc
commit
966ab5f2d6
@ -26,6 +26,6 @@ module.exports = {
|
|||||||
lintRoots: ['lib', 'src', 'spec'],
|
lintRoots: ['lib', 'src', 'spec'],
|
||||||
browserify: {
|
browserify: {
|
||||||
debug: true,
|
debug: true,
|
||||||
fullPaths: false,
|
fullPaths: false
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -120,12 +120,11 @@ gulp.task('scripts', function() {
|
|||||||
sourcemaps = require('gulp-sourcemaps'),
|
sourcemaps = require('gulp-sourcemaps'),
|
||||||
rename = require('gulp-rename');
|
rename = require('gulp-rename');
|
||||||
|
|
||||||
var b = browserify(config.browserify)
|
return browserify(config.browserify)
|
||||||
.transform(require('./lib/canopy-transform'))
|
.transform(require('./lib/canopy-transform'))
|
||||||
.transform(require('babelify'))
|
.transform(require('babelify'))
|
||||||
.add('./src/js/main.js');
|
.add('./src/js/main.js')
|
||||||
|
.bundle()
|
||||||
return b.bundle()
|
|
||||||
.on('error', notify.onError())
|
.on('error', notify.onError())
|
||||||
.pipe(source('./src/js/main.js'))
|
.pipe(source('./src/js/main.js'))
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
|
@ -2,12 +2,12 @@ var through = require('through'),
|
|||||||
canopy = require('canopy');
|
canopy = require('canopy');
|
||||||
|
|
||||||
module.exports = function(file) {
|
module.exports = function(file) {
|
||||||
|
var data = '';
|
||||||
|
|
||||||
if (!/\.peg$/.test(file)) {
|
if (!/\.peg$/.test(file)) {
|
||||||
return through();
|
return through();
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = '';
|
|
||||||
|
|
||||||
return through(
|
return through(
|
||||||
function(buf) {
|
function(buf) {
|
||||||
data += buf;
|
data += buf;
|
||||||
|
@ -25,7 +25,7 @@ describe('parser/javascript/match.js', function() {
|
|||||||
jasmine.objectContaining({
|
jasmine.objectContaining({
|
||||||
content: jasmine.objectContaining({ literal: 'example' })
|
content: jasmine.objectContaining({ literal: 'example' })
|
||||||
})
|
})
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
'example$': {
|
'example$': {
|
||||||
anchorStart: false,
|
anchorStart: false,
|
||||||
|
@ -30,7 +30,9 @@ describe('parser/javascript/node.js', function() {
|
|||||||
this.node.module = {
|
this.node.module = {
|
||||||
definedProperties: {
|
definedProperties: {
|
||||||
example: {
|
example: {
|
||||||
get: function() { return 'value'; }
|
get: function() {
|
||||||
|
return 'value';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -123,7 +123,7 @@ describe('parser/javascript.js', function() {
|
|||||||
it('sets the dimensions of the image', function(done) {
|
it('sets the dimensions of the image', function(done) {
|
||||||
this.parser.render()
|
this.parser.render()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
var svg = this.container.querySelector('svg');
|
let svg = this.container.querySelector('svg');
|
||||||
|
|
||||||
expect(svg.getAttribute('width')).toEqual('62');
|
expect(svg.getAttribute('width')).toEqual('62');
|
||||||
expect(svg.getAttribute('height')).toEqual('44');
|
expect(svg.getAttribute('height')).toEqual('44');
|
||||||
|
@ -17,7 +17,7 @@ describe('regexper.js', function() {
|
|||||||
'</form>',
|
'</form>',
|
||||||
'<div id="error"></div>',
|
'<div id="error"></div>',
|
||||||
'<ul id="warnings"></ul>',
|
'<ul id="warnings"></ul>',
|
||||||
'<div id="regexp-render"></div>',
|
'<div id="regexp-render"></div>'
|
||||||
].join('');
|
].join('');
|
||||||
|
|
||||||
this.regexper = new Regexper(this.root);
|
this.regexper = new Regexper(this.root);
|
||||||
|
@ -44,7 +44,7 @@ window._gaq = (typeof _gaq !== 'undefined') ? _gaq : {
|
|||||||
// Initialize the main page of the site. Functionality is kept in the
|
// Initialize the main page of the site. Functionality is kept in the
|
||||||
// [Regexper class](./regexper.html).
|
// [Regexper class](./regexper.html).
|
||||||
if (document.body.querySelector('#content .application')) {
|
if (document.body.querySelector('#content .application')) {
|
||||||
var regexper = new Regexper(document.body);
|
let regexper = new Regexper(document.body);
|
||||||
|
|
||||||
regexper.detectBuggyHash();
|
regexper.detectBuggyHash();
|
||||||
regexper.bindListeners();
|
regexper.bindListeners();
|
||||||
|
@ -84,7 +84,7 @@ export default class Parser {
|
|||||||
// Once rendering is complete, the rendered expression is positioned and
|
// Once rendering is complete, the rendered expression is positioned and
|
||||||
// the SVG resized to create some padding around the image contents.
|
// the SVG resized to create some padding around the image contents.
|
||||||
.then(result => {
|
.then(result => {
|
||||||
var box = result.getBBox();
|
let box = result.getBBox();
|
||||||
|
|
||||||
result.transform(Snap.matrix()
|
result.transform(Snap.matrix()
|
||||||
.translate(10 - box.x, 10 - box.y));
|
.translate(10 - box.x, 10 - box.y));
|
||||||
|
@ -10,7 +10,7 @@ export default {
|
|||||||
_render() {
|
_render() {
|
||||||
return this.renderLabel(['\u201c', this.literal, '\u201d'])
|
return this.renderLabel(['\u201c', this.literal, '\u201d'])
|
||||||
.then(label => {
|
.then(label => {
|
||||||
var spans = label.selectAll('tspan');
|
let spans = label.selectAll('tspan');
|
||||||
|
|
||||||
// The quote marks get some styling to lighten their color so they are
|
// The quote marks get some styling to lighten their color so they are
|
||||||
// distinct from the actual literal value.
|
// distinct from the actual literal value.
|
||||||
|
@ -29,7 +29,7 @@ export default {
|
|||||||
_render() {
|
_render() {
|
||||||
return this.content.render(this.container.group())
|
return this.content.render(this.container.group())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
var box, paths;
|
let box, paths;
|
||||||
|
|
||||||
// Contents must be transformed based on the repeat that is applied.
|
// Contents must be transformed based on the repeat that is applied.
|
||||||
this.content.transform(this.repeat.contentPosition);
|
this.content.transform(this.repeat.contentPosition);
|
||||||
|
@ -121,7 +121,7 @@ export default class Node {
|
|||||||
|
|
||||||
return this.deferredStep()
|
return this.deferredStep()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
var box = text.getBBox(),
|
let box = text.getBBox(),
|
||||||
margin = 5;
|
margin = 5;
|
||||||
|
|
||||||
text.transform(Snap.matrix()
|
text.transform(Snap.matrix()
|
||||||
@ -161,7 +161,7 @@ export default class Node {
|
|||||||
|
|
||||||
return this.deferredStep()
|
return this.deferredStep()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
var labelBox = label.getBBox(),
|
let labelBox = label.getBBox(),
|
||||||
contentBox = content.getBBox();
|
contentBox = content.getBBox();
|
||||||
|
|
||||||
label.transform(Snap.matrix()
|
label.transform(Snap.matrix()
|
||||||
|
@ -19,7 +19,7 @@ export default {
|
|||||||
return match.render(matchContainer.group());
|
return match.render(matchContainer.group());
|
||||||
}))
|
}))
|
||||||
.then(() => {
|
.then(() => {
|
||||||
var containerBox,
|
let containerBox,
|
||||||
paths;
|
paths;
|
||||||
|
|
||||||
// Space matches vertically in the match container.
|
// Space matches vertically in the match container.
|
||||||
|
@ -24,7 +24,7 @@ export default {
|
|||||||
// Render the content of the regular expression.
|
// Render the content of the regular expression.
|
||||||
return this.regexp.render(this.container.group())
|
return this.regexp.render(this.container.group())
|
||||||
.then(() => {
|
.then(() => {
|
||||||
var box;
|
let box;
|
||||||
|
|
||||||
// Move rendered regexp to account for flag label and to allow for
|
// Move rendered regexp to account for flag label and to allow for
|
||||||
// decorative elements.
|
// decorative elements.
|
||||||
|
Loading…
Reference in New Issue
Block a user