Enforced the eqeqeq rule
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
"default-case": 0,
|
"default-case": 0,
|
||||||
"dot-notation": 2,
|
"dot-notation": 2,
|
||||||
"dot-location": 0,
|
"dot-location": 0,
|
||||||
"eqeqeq": 0,
|
"eqeqeq": 2,
|
||||||
"guard-for-in": 0,
|
"guard-for-in": 0,
|
||||||
"no-alert": 2,
|
"no-alert": 2,
|
||||||
"no-caller": 2,
|
"no-caller": 2,
|
||||||
|
@@ -100,7 +100,7 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getLeadingMargin(node, axis) {
|
function getLeadingMargin(node, axis) {
|
||||||
if (node.style.marginStart != null && isRowDirection(axis)) {
|
if (typeof node.style.marginStart !== 'undefined' && isRowDirection(axis)) {
|
||||||
return node.style.marginStart;
|
return node.style.marginStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,11 +112,11 @@ var computeLayout = (function() {
|
|||||||
case 'column-reverse': value = node.style.marginBottom; break;
|
case 'column-reverse': value = node.style.marginBottom; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null) {
|
if (value !== null && typeof value !== 'undefined') {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.style.margin != null) {
|
if (typeof node.style.margin !== 'undefined') {
|
||||||
return node.style.margin;
|
return node.style.margin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getTrailingMargin(node, axis) {
|
function getTrailingMargin(node, axis) {
|
||||||
if (node.style.marginEnd != null && isRowDirection(axis)) {
|
if (typeof node.style.marginEnd !== 'undefined' && isRowDirection(axis)) {
|
||||||
return node.style.marginEnd;
|
return node.style.marginEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,11 +136,11 @@ var computeLayout = (function() {
|
|||||||
case 'column-reverse': value = node.style.marginTop; break;
|
case 'column-reverse': value = node.style.marginTop; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null) {
|
if (value !== null && typeof value !== 'undefined') {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.style.margin != null) {
|
if (typeof node.style.margin !== 'undefined') {
|
||||||
return node.style.margin;
|
return node.style.margin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getLeadingPadding(node, axis) {
|
function getLeadingPadding(node, axis) {
|
||||||
if (node.style.paddingStart != null && node.style.paddingStart >= 0
|
if (typeof node.style.paddingStart !== 'undefined' && node.style.paddingStart >= 0
|
||||||
&& isRowDirection(axis)) {
|
&& isRowDirection(axis)) {
|
||||||
return node.style.paddingStart;
|
return node.style.paddingStart;
|
||||||
}
|
}
|
||||||
@@ -161,11 +161,11 @@ var computeLayout = (function() {
|
|||||||
case 'column-reverse': value = node.style.paddingBottom; break;
|
case 'column-reverse': value = node.style.paddingBottom; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null && value >= 0) {
|
if (value !== null && value >= 0) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.style.padding != null && node.style.padding >= 0) {
|
if (typeof node.style.padding !== 'undefined' && node.style.padding >= 0) {
|
||||||
return node.style.padding;
|
return node.style.padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getTrailingPadding(node, axis) {
|
function getTrailingPadding(node, axis) {
|
||||||
if (node.style.paddingEnd != null && node.style.paddingEnd >= 0
|
if (typeof node.style.paddingEnd !== 'undefined' && node.style.paddingEnd >= 0
|
||||||
&& isRowDirection(axis)) {
|
&& isRowDirection(axis)) {
|
||||||
return node.style.paddingEnd;
|
return node.style.paddingEnd;
|
||||||
}
|
}
|
||||||
@@ -186,11 +186,11 @@ var computeLayout = (function() {
|
|||||||
case 'column-reverse': value = node.style.paddingTop; break;
|
case 'column-reverse': value = node.style.paddingTop; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null && value >= 0) {
|
if (value !== null && value >= 0) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.style.padding != null && node.style.padding >= 0) {
|
if (typeof node.style.padding !== 'undefined' && node.style.padding >= 0) {
|
||||||
return node.style.padding;
|
return node.style.padding;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,7 +198,7 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getLeadingBorder(node, axis) {
|
function getLeadingBorder(node, axis) {
|
||||||
if (node.style.borderStartWidth != null && node.style.borderStartWidth >= 0
|
if (typeof node.style.borderStartWidth !== 'undefined' && node.style.borderStartWidth >= 0
|
||||||
&& isRowDirection(axis)) {
|
&& isRowDirection(axis)) {
|
||||||
return node.style.borderStartWidth;
|
return node.style.borderStartWidth;
|
||||||
}
|
}
|
||||||
@@ -211,11 +211,11 @@ var computeLayout = (function() {
|
|||||||
case 'column-reverse': value = node.style.borderBottomWidth; break;
|
case 'column-reverse': value = node.style.borderBottomWidth; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null && value >= 0) {
|
if (value !== null && value >= 0) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.style.borderWidth != null && node.style.borderWidth >= 0) {
|
if (typeof node.style.borderWidth !== 'undefined' && node.style.borderWidth >= 0) {
|
||||||
return node.style.borderWidth;
|
return node.style.borderWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getTrailingBorder(node, axis) {
|
function getTrailingBorder(node, axis) {
|
||||||
if (node.style.borderEndWidth != null && node.style.borderEndWidth >= 0
|
if (typeof node.style.borderEndWidth !== 'undefined' && node.style.borderEndWidth >= 0
|
||||||
&& isRowDirection(axis)) {
|
&& isRowDirection(axis)) {
|
||||||
return node.style.borderEndWidth;
|
return node.style.borderEndWidth;
|
||||||
}
|
}
|
||||||
@@ -236,11 +236,11 @@ var computeLayout = (function() {
|
|||||||
case 'column-reverse': value = node.style.borderTopWidth; break;
|
case 'column-reverse': value = node.style.borderTopWidth; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null && value >= 0) {
|
if (value !== null && value >= 0) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node.style.borderWidth != null && node.style.borderWidth >= 0) {
|
if (typeof node.style.borderWidth !== undefined && node.style.borderWidth >= 0) {
|
||||||
return node.style.borderWidth;
|
return node.style.borderWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -357,19 +357,19 @@ var computeLayout = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isDimDefined(node, axis) {
|
function isDimDefined(node, axis) {
|
||||||
return node.style[dim[axis]] != null && node.style[dim[axis]] >= 0;
|
return typeof node.style[dim[axis]] !== 'undefined' && node.style[dim[axis]] >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isPosDefined(node, pos) {
|
function isPosDefined(node, pos) {
|
||||||
return node.style[pos] != null;
|
return typeof node.style[pos] !== 'undefined';
|
||||||
}
|
}
|
||||||
|
|
||||||
function isMeasureDefined(node) {
|
function isMeasureDefined(node) {
|
||||||
return node.style.measure != null;
|
return typeof node.style.measure !== 'undefined';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPosition(node, pos) {
|
function getPosition(node, pos) {
|
||||||
if (node.style[pos] != null) {
|
if (typeof node.style[pos] !== 'undefined') {
|
||||||
return node.style[pos];
|
return node.style[pos];
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -391,10 +391,10 @@ var computeLayout = (function() {
|
|||||||
}[axis];
|
}[axis];
|
||||||
|
|
||||||
var boundValue = value;
|
var boundValue = value;
|
||||||
if (max != null && max >= 0 && boundValue > max) {
|
if (max !== null && max >= 0 && boundValue > max) {
|
||||||
boundValue = max;
|
boundValue = max;
|
||||||
}
|
}
|
||||||
if (min != null && min >= 0 && boundValue < min) {
|
if (min !== null && min >= 0 && boundValue < min) {
|
||||||
boundValue = min;
|
boundValue = min;
|
||||||
}
|
}
|
||||||
return boundValue;
|
return boundValue;
|
||||||
@@ -410,7 +410,7 @@ var computeLayout = (function() {
|
|||||||
// When the user specifically sets a value for width or height
|
// When the user specifically sets a value for width or height
|
||||||
function setDimensionFromStyle(node, axis) {
|
function setDimensionFromStyle(node, axis) {
|
||||||
// The parent already computed us a width or height. We just skip it
|
// The parent already computed us a width or height. We just skip it
|
||||||
if (node.layout[dim[axis]] != null) {
|
if (typeof node.layout[dim[axis]] !== 'undefined') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// We only run if there's a width or height defined
|
// We only run if there's a width or height defined
|
||||||
@@ -433,7 +433,7 @@ var computeLayout = (function() {
|
|||||||
// If both left and right are defined, then use left. Otherwise return
|
// If both left and right are defined, then use left. Otherwise return
|
||||||
// +left or -right depending on which is defined.
|
// +left or -right depending on which is defined.
|
||||||
function getRelativePosition(node, axis) {
|
function getRelativePosition(node, axis) {
|
||||||
if (node.style[leading[axis]] != null) {
|
if (typeof node.style[leading[axis]] !== 'undefined') {
|
||||||
return getPosition(node, leading[axis]);
|
return getPosition(node, leading[axis]);
|
||||||
}
|
}
|
||||||
return -getPosition(node, trailing[axis]);
|
return -getPosition(node, trailing[axis]);
|
||||||
@@ -565,8 +565,8 @@ var computeLayout = (function() {
|
|||||||
// immediately stacked in the initial loop will not be touched again
|
// immediately stacked in the initial loop will not be touched again
|
||||||
// in <Loop C>.
|
// in <Loop C>.
|
||||||
var/*bool*/ isSimpleStackMain =
|
var/*bool*/ isSimpleStackMain =
|
||||||
(isMainDimDefined && justifyContent == CSS_JUSTIFY_FLEX_START) ||
|
(isMainDimDefined && justifyContent === CSS_JUSTIFY_FLEX_START) ||
|
||||||
(!isMainDimDefined && justifyContent != CSS_JUSTIFY_CENTER);
|
(!isMainDimDefined && justifyContent !== CSS_JUSTIFY_CENTER);
|
||||||
var/*int*/ firstComplexMain = (isSimpleStackMain ? childCount : startLine);
|
var/*int*/ firstComplexMain = (isSimpleStackMain ? childCount : startLine);
|
||||||
|
|
||||||
// Use the initial line loop to position children in the cross axis for
|
// Use the initial line loop to position children in the cross axis for
|
||||||
@@ -704,7 +704,7 @@ var computeLayout = (function() {
|
|||||||
// we found a non-trivial child. The remaining children will be laid out
|
// we found a non-trivial child. The remaining children will be laid out
|
||||||
// in <Loop C>.
|
// in <Loop C>.
|
||||||
if (isSimpleStackMain &&
|
if (isSimpleStackMain &&
|
||||||
(getPositionType(child) != CSS_POSITION_RELATIVE || isFlex(child))) {
|
(getPositionType(child) !== CSS_POSITION_RELATIVE || isFlex(child))) {
|
||||||
isSimpleStackMain = false;
|
isSimpleStackMain = false;
|
||||||
firstComplexMain = i;
|
firstComplexMain = i;
|
||||||
}
|
}
|
||||||
@@ -713,8 +713,8 @@ var computeLayout = (function() {
|
|||||||
// we found a non-trivial child. The remaining children will be laid out
|
// we found a non-trivial child. The remaining children will be laid out
|
||||||
// in <Loop D>.
|
// in <Loop D>.
|
||||||
if (isSimpleStackCross &&
|
if (isSimpleStackCross &&
|
||||||
(getPositionType(child) != CSS_POSITION_RELATIVE ||
|
(getPositionType(child) !== CSS_POSITION_RELATIVE ||
|
||||||
(alignItem !== CSS_ALIGN_STRETCH && alignItem != CSS_ALIGN_FLEX_START) ||
|
(alignItem !== CSS_ALIGN_STRETCH && alignItem !== CSS_ALIGN_FLEX_START) ||
|
||||||
isUndefined(child.layout[dim[crossAxis]]))) {
|
isUndefined(child.layout[dim[crossAxis]]))) {
|
||||||
isSimpleStackCross = false;
|
isSimpleStackCross = false;
|
||||||
firstComplexCross = i;
|
firstComplexCross = i;
|
||||||
@@ -1048,8 +1048,8 @@ var computeLayout = (function() {
|
|||||||
paddingAndBorderAxisMain
|
paddingAndBorderAxisMain
|
||||||
);
|
);
|
||||||
|
|
||||||
if (mainAxis == CSS_FLEX_DIRECTION_ROW_REVERSE ||
|
if (mainAxis === CSS_FLEX_DIRECTION_ROW_REVERSE ||
|
||||||
mainAxis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
|
mainAxis === CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
|
||||||
needsMainTrailingPos = true;
|
needsMainTrailingPos = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1063,8 +1063,8 @@ var computeLayout = (function() {
|
|||||||
paddingAndBorderAxisCross
|
paddingAndBorderAxisCross
|
||||||
);
|
);
|
||||||
|
|
||||||
if (crossAxis == CSS_FLEX_DIRECTION_ROW_REVERSE ||
|
if (crossAxis === CSS_FLEX_DIRECTION_ROW_REVERSE ||
|
||||||
crossAxis == CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
|
crossAxis === CSS_FLEX_DIRECTION_COLUMN_REVERSE) {
|
||||||
needsCrossTrailingPos = true;
|
needsCrossTrailingPos = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user