summaryrefslogtreecommitdiff
path: root/js/console_table.ts
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-03-10 04:30:38 +1100
committerRyan Dahl <ry@tinyclouds.org>2019-03-09 12:30:38 -0500
commit034e2cc02829c9244b32232074c7a48af827a2fb (patch)
treebade01606a1ee076c1f753ce99c97ddb1e4edf30 /js/console_table.ts
parent8c7a12d1b258f0ef5ab27f49c424331d43e8d97f (diff)
Migrate from tslint to eslint for linting (#1905)
Diffstat (limited to 'js/console_table.ts')
-rw-r--r--js/console_table.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/js/console_table.ts b/js/console_table.ts
index 735ed0f9e..d7cae124c 100644
--- a/js/console_table.ts
+++ b/js/console_table.ts
@@ -51,7 +51,7 @@ function renderRow(row: string[], columnWidths: number[]): string {
}
export function cliTable(head: string[], columns: string[][]): string {
- const rows = [];
+ const rows: string[][] = [];
const columnWidths = head.map((h: string) => countBytes(h));
const longestColumn = columns.reduce(
(n: number, a: string[]) => Math.max(n, a.length),
@@ -64,10 +64,7 @@ export function cliTable(head: string[], columns: string[][]): string {
if (rows[j] === undefined) {
rows[j] = [];
}
- // tslint:disable-next-line:no-any
- const value = ((rows[j][i] as any) = column.hasOwnProperty(j)
- ? column[j]
- : "");
+ const value = (rows[j][i] = column.hasOwnProperty(j) ? column[j] : "");
const width = columnWidths[i] || 0;
const counted = countBytes(value);
columnWidths[i] = Math.max(width, counted);