/** * vigiles generate-schema — emit a JSON Schema for `vigiles:` frontmatter. * * Sibling of `generate-types` (which emits a `.d.ts` for the spec.ts path). * This emits `.vigiles/schema.json` so a YAML LSP can autocomplete rule * names and squiggle typos in markdown frontmatter: * * --- * # yaml-language-server: $schema=./.vigiles/schema.json * vigiles: * enforce: * - rule: eslint/no-consolee # red squiggle in VS Code * --- * * The `rule` enum is populated from the project's ACTUAL enabled linter * rules — the same discovery `generate-types` runs — so the schema reflects * what is really enforceable, not a static catalog. */ export interface GenerateSchemaOptions { /** The repo root. Required: no cwd fallback. */ readonly basePath: string; /** * Custom linters from `.vigilesrc.json` (`rulesDir`-backed). These aren't * auto-discovered by `generate-types`, but `vigiles lint` resolves their * rules via `checkLinterRule`, so the schema enum must include them too — * otherwise the YAML LSP false-flags a rule that CI accepts. */ linters?: Record; } export interface GenerateSchemaResult { /** The JSON Schema document. */ schema: Record; /** Pretty-printed JSON, newline-terminated. */ json: string; /** Rule names included in the enum (sorted, deduped). */ ruleNames: string[]; /** Linters discovered, with rule counts. */ linters: { linter: string; count: number; }[]; } /** * Build a JSON Schema for the `vigiles:` frontmatter block from the * project's discovered linter rules. When no rules are discoverable the * `rule` field falls back to a freeform string so the schema never * false-flags a valid reference. */ export declare function generateSchema(options: Readonly): GenerateSchemaResult; //# sourceMappingURL=generate-schema.d.ts.map