From a7ef481dee333e0b8abbc27f3d22c98727128945 Mon Sep 17 00:00:00 2001 From: keindev Date: Thu, 15 Feb 2024 01:02:18 +0300 Subject: [PATCH] types: fix lint warnings --- src/ProgressBar.ts | 2 +- src/Task.ts | 10 +++++----- src/TaskTree.ts | 4 ++-- src/Theme.ts | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ProgressBar.ts b/src/ProgressBar.ts index 057d939b..907c89e9 100644 --- a/src/ProgressBar.ts +++ b/src/ProgressBar.ts @@ -94,7 +94,7 @@ export class ProgressBar implements Required = new Map(); diff --git a/src/Task.ts b/src/Task.ts index 66525cf5..8459f8a8 100644 --- a/src/Task.ts +++ b/src/Task.ts @@ -23,15 +23,15 @@ export interface ITaskOptions { /** Entity for managing a task - includes all child objects (informational messages, errors, progress bars, and tasks) */ export class Task { - #autoClear: boolean; + readonly #autoClear: boolean; #bars: ProgressBar[] = []; - #errors: string[] = []; - #id: number; - #logs = new Set(); + readonly #errors: string[] = []; + readonly #id: number; + readonly #logs = new Set(); #status: TaskStatus; #subtasks: Task[] = []; #text: string; - #warnings = new Set(); + readonly #warnings = new Set(); constructor(text: string, { status, autoClear }: ITaskOptions = {}) { this.#id = ++uid; diff --git a/src/TaskTree.ts b/src/TaskTree.ts index a01c2029..7253d98e 100644 --- a/src/TaskTree.ts +++ b/src/TaskTree.ts @@ -22,13 +22,13 @@ export class TaskTree { #autoClear = false; #handle: NodeJS.Timeout | undefined; - #manager: UpdateManager; + readonly #manager: UpdateManager; #offset = 0; #paused = false; #silent = false; #started = false; #tasks: Task[]; - #theme: Theme; + readonly #theme: Theme; private constructor(theme?: ThemeOptions) { this.#tasks = []; diff --git a/src/Theme.ts b/src/Theme.ts index ab524e50..3e28117f 100644 --- a/src/Theme.ts +++ b/src/Theme.ts @@ -68,9 +68,9 @@ export type ThemeOptions = { export class Theme { static INDENT = ' '; - #badges: Map = new Map(); - #colors: Map = new Map(); - #symbols: Map = new Map(); + readonly #badges: Map = new Map(); + readonly #colors: Map = new Map(); + readonly #symbols: Map = new Map(); constructor(options?: ThemeOptions) { if (options) {