779ca4872b
- Removed Prettier configuration files (.prettierignore and .prettierrc) and migrated formatting to Biome. - Updated Biome configuration from version 2.3.11 to 2.3.12 and changed arrowParentheses rule from 'always' to 'asNeeded'. - Pinned @biomejs/biome dependency to exact version 2.3.12 in package.json and bun.lock. - Applied consistent arrow function formatting across 489 files by removing unnecessary parentheses around single parameters. - Removed blank lines after comment blocks and reorganized imports for consistency across the codebase.
35 lines
881 B
TypeScript
35 lines
881 B
TypeScript
/**
|
|
* Settings Capability
|
|
*
|
|
* Configuration settings from various sources (JSON, TOML, etc.)
|
|
*/
|
|
import { defineCapability } from ".";
|
|
import type { SourceMeta } from "./types";
|
|
|
|
/**
|
|
* A settings file.
|
|
*/
|
|
export interface Settings {
|
|
/** Absolute path to settings file */
|
|
path: string;
|
|
/** Parsed settings data */
|
|
data: Record<string, unknown>;
|
|
/** Source level */
|
|
level: "user" | "project";
|
|
/** Source metadata */
|
|
_source: SourceMeta;
|
|
}
|
|
|
|
export const settingsCapability = defineCapability<Settings>({
|
|
id: "settings",
|
|
displayName: "Settings",
|
|
description: "Configuration settings from various sources",
|
|
// Settings are merged, not deduplicated by key
|
|
key: () => undefined,
|
|
validate: settings => {
|
|
if (!settings.path) return "Missing path";
|
|
if (!settings.data || typeof settings.data !== "object") return "Missing or invalid data";
|
|
return undefined;
|
|
},
|
|
});
|