Skip to content

Commit

Permalink
eslint fixes. same line else-if chains
Browse files Browse the repository at this point in the history
  • Loading branch information
drom committed Nov 3, 2023
1 parent efe47d2 commit 9d4d183
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
9 changes: 3 additions & 6 deletions lib/render-marks.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ function ticktock (cxt, ref1, ref2, x, dx, y, len) {

if (typeof val === 'string') {
val = val.trim().split(/\s+/);
} else
if (typeof val === 'number' || typeof val === 'boolean') {
} else if (typeof val === 'number' || typeof val === 'boolean') {
offset = Number(val);
val = [];
for (let i = 0; i < len; i += 1) {
Expand All @@ -40,8 +39,7 @@ function ticktock (cxt, ref1, ref2, x, dx, y, len) {
if (Array.isArray(val)) {
if (val.length === 0) {
return [];
} else
if (val.length === 1) {
} else if (val.length === 1) {
offset = Number(val[0]);
if (isNaN(offset)) {
L = val;
Expand All @@ -50,8 +48,7 @@ function ticktock (cxt, ref1, ref2, x, dx, y, len) {
L[i] = i + offset;
}
}
} else
if (val.length === 2) {
} else if (val.length === 2) {
offset = Number(val[0]);
const step = Number(val[1]);
const tmp = val[1].split('.');
Expand Down
3 changes: 1 addition & 2 deletions lib/render-over-under.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ function renderOverUnder (el, key, lane) {
}
if (dot === '0') {
start = undefined;
} else
if (dot !== '.') {
} else if (dot !== '.') {
start = i;
color = colors[dot] || colors[1];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"RTL"
],
"devDependencies": {
"@drom/eslint-config": "^0.11.0",
"@drom/eslint-config": "^0.12.0",
"browserify": "^17.0.0",
"chai": "^4.3",
"coveralls": "^3.1.1",
Expand Down

0 comments on commit 9d4d183

Please sign in to comment.