From 539ab947a49b0351759df5192ed44f17d217b2f1 Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Fri, 2 May 2025 09:31:18 -0700 Subject: Use parameter properties where possible. (#242) --- packages/cli/src/ui/themes/theme.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'packages/cli/src') diff --git a/packages/cli/src/ui/themes/theme.ts b/packages/cli/src/ui/themes/theme.ts index 76f692c6..88868790 100644 --- a/packages/cli/src/ui/themes/theme.ts +++ b/packages/cli/src/ui/themes/theme.ts @@ -65,18 +65,11 @@ export const ansiTheme: ColorsTheme = { }; export class Theme { - /** - * The user-facing name of the theme. - */ - readonly name: string; - /** * The default foreground color for text when no specific highlight rule applies. * This is an Ink-compatible color string (hex or name). */ readonly defaultColor: string; - - readonly colors: ColorsTheme; /** * Stores the mapping from highlight.js class names (e.g., 'hljs-keyword') * to Ink-compatible color strings (hex or name). @@ -256,13 +249,11 @@ export class Theme { * @param rawMappings The raw CSSProperties mappings from a react-syntax-highlighter theme object. */ constructor( - name: string, + readonly name: string, rawMappings: Record, - colors: ColorsTheme, + readonly colors: ColorsTheme, ) { - this.name = name; this._colorMap = Object.freeze(this._buildColorMap(rawMappings)); // Build and freeze the map - this.colors = colors; // Determine the default foreground color const rawDefaultColor = rawMappings['hljs']?.color; -- cgit v1.2.3