Enable brace-style eslint rule

This commit is contained in:
Quincy Morgan
2020-11-10 13:49:48 -05:00
parent f8ddfa9224
commit d247ec3aed
7 changed files with 21 additions and 20 deletions

View File

@@ -19,6 +19,7 @@
"array-callback-return": "warn",
"arrow-spacing": "warn",
"block-scoped-var": "error",
"brace-style": ["warn", "1tbs", { "allowSingleLine": true }],
"class-methods-use-this": "error",
"complexity": ["warn", 50],
"default-case-last": "error",

View File

@@ -136,23 +136,19 @@ function parseLaneDirections(tags, isOneWay, laneCount) {
forward = 0;
bothways = 0;
backward = laneCount;
}
else if (isOneWay) {
} else if (isOneWay) {
forward = laneCount;
bothways = 0;
backward = 0;
}
else if (isNaN(forward) && isNaN(backward)) {
} else if (isNaN(forward) && isNaN(backward)) {
backward = Math.floor((laneCount - bothways) / 2);
forward = laneCount - bothways - backward;
}
else if (isNaN(forward)) {
} else if (isNaN(forward)) {
if (backward > laneCount - bothways) {
backward = laneCount - bothways;
}
forward = laneCount - bothways - backward;
}
else if (isNaN(backward)) {
} else if (isNaN(backward)) {
if (forward > laneCount - bothways) {
forward = laneCount - bothways;
}

View File

@@ -83,8 +83,7 @@ export function svgMidpoints(projection, context) {
point = geoLineIntersection([a.loc, b.loc], [poly[k], poly[k + 1]]);
if (point &&
geoVecLength(projection(a.loc), projection(point)) > 20 &&
geoVecLength(projection(b.loc), projection(point)) > 20)
{
geoVecLength(projection(b.loc), projection(point)) > 20) {
loc = point;
break;
}

View File

@@ -118,8 +118,7 @@ export function svgTagClasses() {
if (v === 'yes') { // e.g. `railway=rail + abandoned=yes`
status = k;
}
else if (primary && primary === v) { // e.g. `railway=rail + abandoned=railway`
} else if (primary && primary === v) { // e.g. `railway=rail + abandoned=railway`
status = k;
} else if (!primary && primaries.indexOf(v) !== -1) { // e.g. `abandoned=railway`
status = k;

View File

@@ -193,8 +193,7 @@ export function uiCurtain(containerNode) {
if (tooltipBox.left + tooltipBox.width + tooltipArrow + tooltipWidth > w - 70) {
side = 'left';
pos = [tooltipBox.left - tooltipWidth - tooltipArrow, tipY];
}
else {
} else {
side = 'right';
pos = [tooltipBox.left + tooltipBox.width + tooltipArrow, tipY];
}
@@ -217,8 +216,7 @@ export function uiCurtain(containerNode) {
if (side === 'left' || side === 'right') {
if (pos[1] < 60) {
shiftY = 60 - pos[1];
}
else if (pos[1] + tip.height > h - 100) {
} else if (pos[1] + tip.height > h - 100) {
shiftY = h - pos[1] - tip.height - 100;
}
}

View File

@@ -31,9 +31,16 @@ export var JXON = new (function () {
if (bChildren) {
for (var oNode, nItem = 0; nItem < oParentNode.childNodes.length; nItem++) {
oNode = oParentNode.childNodes.item(nItem);
if (oNode.nodeType === 4) { sCollectedTxt += oNode.nodeValue; } /* nodeType is 'CDATASection' (4) */
else if (oNode.nodeType === 3) { sCollectedTxt += oNode.nodeValue.trim(); } /* nodeType is 'Text' (3) */
else if (oNode.nodeType === 1 && !oNode.prefix) { aCache.push(oNode); } /* nodeType is 'Element' (1) */
if (oNode.nodeType === 4) {
/* nodeType is 'CDATASection' (4) */
sCollectedTxt += oNode.nodeValue;
} else if (oNode.nodeType === 3) {
/* nodeType is 'Text' (3) */
sCollectedTxt += oNode.nodeValue.trim();
} else if (oNode.nodeType === 1 && !oNode.prefix) {
/* nodeType is 'Element' (1) */
aCache.push(oNode);
}
}
}

View File

@@ -297,8 +297,9 @@ export function utilZoomPan() {
} else if (g.pointer0) {
p = g.pointer0[0];
l = g.pointer0[1];
} else {
return;
}
else return;
g.zoom(d3_event, 'touch', constrain(translate(t, p, l), g.extent, translateExtent));
}