From 5d566cfeca712f9439abe5fea2c8c838f085dcd9 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 4 Dec 2023 19:57:38 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/cli/preferences/index.ts | 31 ++++++++++++++------- packages/astro/src/preferences/index.ts | 15 +++++++--- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/packages/astro/src/cli/preferences/index.ts b/packages/astro/src/cli/preferences/index.ts index d6e76db2af..4fd29cdfea 100644 --- a/packages/astro/src/cli/preferences/index.ts +++ b/packages/astro/src/cli/preferences/index.ts @@ -10,7 +10,12 @@ import { resolveConfig } from '../../core/config/config.js'; import { createSettings } from '../../core/config/settings.js'; import * as msg from '../../core/messages.js'; import { DEFAULT_PREFERENCES } from '../../preferences/defaults.js'; -import { coerce, isValidKey, type PreferenceKey, type PreferenceLocation } from '../../preferences/index.js'; +import { + coerce, + isValidKey, + type PreferenceKey, + type PreferenceLocation, +} from '../../preferences/index.js'; import { createLoggerFromFlags, flagsToAstroInlineConfig } from '../flags.js'; // @ts-expect-error flattie types are mispackaged import { flattie } from 'flattie'; @@ -300,15 +305,21 @@ function formatTable( b )} ${space(colBLength - b.toString().length - 3)} ${dim(chars.v)}`; } - const top = dim(`${chars.topLeft}${chars.h.repeat(colALength + 1)}${chars.hBottom}${chars.h.repeat( - colBLength - )}${chars.topRight}`); - const bottom = dim(`${chars.bottomLeft}${chars.h.repeat(colALength + 1)}${chars.hTop}${chars.h.repeat( - colBLength - )}${chars.bottomRight}`); - const divider = dim(`${chars.vRightThick}${chars.hThick.repeat(colALength + 1)}${ - chars.hThickCross - }${chars.hThick.repeat(colBLength)}${chars.vLeftThick}`); + const top = dim( + `${chars.topLeft}${chars.h.repeat(colALength + 1)}${chars.hBottom}${chars.h.repeat( + colBLength + )}${chars.topRight}` + ); + const bottom = dim( + `${chars.bottomLeft}${chars.h.repeat(colALength + 1)}${chars.hTop}${chars.h.repeat( + colBLength + )}${chars.bottomRight}` + ); + const divider = dim( + `${chars.vRightThick}${chars.hThick.repeat(colALength + 1)}${ + chars.hThickCross + }${chars.hThick.repeat(colBLength)}${chars.vLeftThick}` + ); const rows: string[] = [top, formatRow(-1, colA, colB, bold), divider]; let i = 0; for (const [key, value] of Object.entries(object)) { diff --git a/packages/astro/src/preferences/index.ts b/packages/astro/src/preferences/index.ts index 56249f5344..ee50261158 100644 --- a/packages/astro/src/preferences/index.ts +++ b/packages/astro/src/preferences/index.ts @@ -27,9 +27,11 @@ export interface PreferenceOptions { location?: PreferenceLocation; } -type DeepPartial = T extends object ? { - [P in keyof T]?: DeepPartial; -} : T; +type DeepPartial = T extends object + ? { + [P in keyof T]?: DeepPartial; + } + : T; export type PreferenceKey = DotKeys; export interface PreferenceList extends Record> { @@ -82,7 +84,12 @@ export default function createPreferences(config: AstroConfig): AstroPreferences stores[location].set(key, value); }, async getAll() { - return Object.assign({}, DEFAULT_PREFERENCES, stores['global'].getAll(), stores['project'].getAll()); + return Object.assign( + {}, + DEFAULT_PREFERENCES, + stores['global'].getAll(), + stores['project'].getAll() + ); }, async list() { return {