Skip to content

Commit 500bcd1

Browse files
committed
cmd/hiveview: enable some more useful eslint rules
1 parent b5f0ee9 commit 500bcd1

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

cmd/hiveview/assets/.eslintrc.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,23 @@ module.exports = {
2929
"no-unused-vars": [
3030
"error", { "vars": "all", "args": "none", "ignoreRestSiblings": false }
3131
],
32+
"no-unused-private-class-members": [
33+
"error"
34+
],
35+
"no-else-return": [
36+
"error"
37+
],
38+
"no-unreachable-loop": [
39+
"error"
40+
],
41+
"no-duplicate-imports": [
42+
"error"
43+
],
44+
"no-unmodified-loop-condition": [
45+
"warn"
46+
],
47+
// "no-use-before-define": [
48+
// "warn"
49+
// ],
3250
}
3351
}

cmd/hiveview/assets/lib/app-suite.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,15 @@ function testCaseDuration(test) {
238238
function scrollToTest(suiteData, testIndex) {
239239
let table = $('#execresults').dataTable().api();
240240
let row = findRowByTestIndex(table, testIndex);
241-
if (row) {
242-
if (row.page() != table.page()) {
243-
table.page(row.page()).draw(false);
244-
}
245-
row.node().scrollIntoView();
246-
toggleTestDetails(suiteData, table, row.node());
247-
} else {
241+
if (!row) {
248242
console.error('invalid row in scrollToTest:', testIndex);
243+
return;
249244
}
245+
if (row.page() != table.page()) {
246+
table.page(row.page()).draw(false);
247+
}
248+
row.node().scrollIntoView();
249+
toggleTestDetails(suiteData, table, row.node());
250250
}
251251

252252
// findRowByTestIndex finds the dataTables row corresponding to a testIndex.
@@ -383,9 +383,8 @@ function countLines(text) {
383383
offset = text.indexOf('\n', offset);
384384
if (offset == -1) {
385385
return lines;
386-
} else {
387-
offset++;
388386
}
387+
offset++;
389388
}
390389
}
391390

0 commit comments

Comments
 (0)