summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/cli/preferences/index.ts31
-rw-r--r--packages/astro/src/preferences/index.ts15
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 d6e76db2a..4fd29cdfe 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 56249f534..ee5026115 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> = T extends object ? {
- [P in keyof T]?: DeepPartial<T[P]>;
-} : T;
+type DeepPartial<T> = T extends object
+ ? {
+ [P in keyof T]?: DeepPartial<T[P]>;
+ }
+ : T;
export type PreferenceKey = DotKeys<Preferences>;
export interface PreferenceList extends Record<PreferenceLocation, DeepPartial<Preferences>> {
@@ -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 {