Fix jshint issues
* add .jshintrc * address semicolon errors * ignore 'already defined' errors
This commit is contained in:
14
.jshintrc
Normal file
14
.jshintrc
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"browser": true,
|
||||||
|
"shadow": true,
|
||||||
|
"globals": {
|
||||||
|
"describe": true,
|
||||||
|
"beforeEach": true,
|
||||||
|
"afterEach": true,
|
||||||
|
"spyOn": true,
|
||||||
|
"it": true,
|
||||||
|
"xit": true,
|
||||||
|
"expect": true,
|
||||||
|
"require": true
|
||||||
|
}
|
||||||
|
}
|
@@ -119,7 +119,7 @@ var JavaTranspiler = {
|
|||||||
}
|
}
|
||||||
return allTestsInJava.join('\n\n');
|
return allTestsInJava.join('\n\n');
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
if (typeof module !== 'undefined') {
|
if (typeof module !== 'undefined') {
|
||||||
module.exports = JavaTranspiler;
|
module.exports = JavaTranspiler;
|
||||||
|
@@ -189,7 +189,7 @@ var computeLayout = (function() {
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
|
|
||||||
var CSS_UNDEFINED = undefined;
|
var CSS_UNDEFINED;
|
||||||
|
|
||||||
var CSS_FLEX_DIRECTION_ROW = 'row';
|
var CSS_FLEX_DIRECTION_ROW = 'row';
|
||||||
var CSS_FLEX_DIRECTION_COLUMN = 'column';
|
var CSS_FLEX_DIRECTION_COLUMN = 'column';
|
||||||
@@ -283,7 +283,7 @@ var computeLayout = (function() {
|
|||||||
// Pre-fill dimensions when using absolute position and both offsets for the axis are defined (either both
|
// Pre-fill dimensions when using absolute position and both offsets for the axis are defined (either both
|
||||||
// left and right or top and bottom).
|
// left and right or top and bottom).
|
||||||
for (var/*int*/ ii = 0; ii < 2; ii++) {
|
for (var/*int*/ ii = 0; ii < 2; ii++) {
|
||||||
var/*css_flex_direction_t*/ axis = (ii != 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
var/*css_flex_direction_t*/ axis = (ii !== 0) ? CSS_FLEX_DIRECTION_ROW : CSS_FLEX_DIRECTION_COLUMN;
|
||||||
if (!isUndefined(node.layout[dim[axis]]) &&
|
if (!isUndefined(node.layout[dim[axis]]) &&
|
||||||
!isDimDefined(child, axis) &&
|
!isDimDefined(child, axis) &&
|
||||||
isPosDefined(child, leading[axis]) &&
|
isPosDefined(child, leading[axis]) &&
|
||||||
|
@@ -101,6 +101,7 @@ describe('Random layout', function() {
|
|||||||
delete node.style.flex;
|
delete node.style.flex;
|
||||||
delete node.style.position;
|
delete node.style.position;
|
||||||
|
|
||||||
|
/*jshint -W083 */
|
||||||
it('should layout randomly #' + i +'.', function(node) {
|
it('should layout randomly #' + i +'.', function(node) {
|
||||||
if (JSON.stringify(computeLayout(node)) !== JSON.stringify(computeDOMLayout(node))) {
|
if (JSON.stringify(computeLayout(node)) !== JSON.stringify(computeDOMLayout(node))) {
|
||||||
node = reduceTest(node);
|
node = reduceTest(node);
|
||||||
|
@@ -650,7 +650,7 @@ describe('Layout', function() {
|
|||||||
{width: 347.5, height: 0, top: 0, left: 0},
|
{width: 347.5, height: 0, top: 0, left: 0},
|
||||||
{width: 347.5, height: 0, top: 0, left: 352.5}
|
{width: 347.5, height: 0, top: 0, left: 352.5}
|
||||||
]}
|
]}
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should layout node with flex and overflow', function() {
|
it('should layout node with flex and overflow', function() {
|
||||||
@@ -687,14 +687,14 @@ describe('Layout', function() {
|
|||||||
{width: 0, height: 500, top: 0, left: 0},
|
{width: 0, height: 500, top: 0, left: 0},
|
||||||
{width: 0, height: 0, top: 500, left: 0},
|
{width: 0, height: 0, top: 500, left: 0},
|
||||||
]}
|
]}
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should layout node with borderWidth', function() {
|
it('should layout node with borderWidth', function() {
|
||||||
testLayout(
|
testLayout(
|
||||||
{style: {borderWidth: 5}},
|
{style: {borderWidth: 5}},
|
||||||
{width: 10, height: 10, top: 0, left: 0}
|
{width: 10, height: 10, top: 0, left: 0}
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should layout node with borderWidth and position: absolute, top', function() {
|
it('should layout node with borderWidth and position: absolute, top', function() {
|
||||||
@@ -705,7 +705,7 @@ describe('Layout', function() {
|
|||||||
{width: 0, height: 1, top: 0, left: 0, children: [
|
{width: 0, height: 1, top: 0, left: 0, children: [
|
||||||
{width: 0, height: 0, top: 0, left: 0}
|
{width: 0, height: 0, top: 0, left: 0}
|
||||||
]}
|
]}
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should layout node with borderWidth and position: absolute, top. cross axis', function() {
|
it('should layout node with borderWidth and position: absolute, top. cross axis', function() {
|
||||||
@@ -716,7 +716,7 @@ describe('Layout', function() {
|
|||||||
{width: 2, height: 2, top: 0, left: 0, children: [
|
{width: 2, height: 2, top: 0, left: 0, children: [
|
||||||
{width: 0, height: 0, top: 1, left: 6}
|
{width: 0, height: 0, top: 1, left: 6}
|
||||||
]}
|
]}
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should correctly take into account min padding for stretch', function() {
|
it('should correctly take into account min padding for stretch', function() {
|
||||||
|
Reference in New Issue
Block a user