/** * A required script entry. Can be either: * - A string (script name only, no default value) * - An object with a single key-value pair (script name → default value for auto-fix) * * @example * ```typescript * // Script must exist, no auto-fix available * "test" * * // Script must exist, auto-fix will add this value if missing * { lint: "biome lint ." } * ``` * * @alpha */ export type RequiredScriptEntry = string | Record; /** * Configuration for the RequiredScripts policy. * * @alpha */ export interface RequiredScriptsConfig { /** * Scripts that must be present in package.json. * * @remarks * Each entry can be: * - A string: Script must exist, no auto-fix available, content not validated * - An object `{ scriptName: "default value" }`: Script must exist, auto-fix adds the * default value if missing, but existing scripts with different content still pass * * @example * ```typescript * scripts: [ * "test", // Must exist, no auto-fix * { lint: "biome lint ." }, // Must exist, auto-fix available * { clean: "rimraf dist esm" }, // Must exist, auto-fix available * ] * ``` */ scripts: RequiredScriptEntry[]; } /** * A policy that validates required scripts exist in package.json. * * @remarks * Use this policy when you want to ensure specific scripts are present. * Scripts can be specified with optional default values that enable auto-fix. * * Note: This policy only checks for script presence. It does NOT validate * the script's content. Use ExactScripts for content validation. * * @example * ```typescript * import { policy } from "repopo"; * import { RequiredScripts } from "repopo/policies"; * * policy(RequiredScripts, { * scripts: [ * "test", // Must exist, no auto-fix * { lint: "biome lint ." }, // Must exist, auto-fix adds default if missing * { clean: "rimraf dist esm" }, // Must exist, auto-fix adds default if missing * ], * }) * ``` * * @alpha */ export declare const RequiredScripts: import("../policy.js").PolicyShape; //# sourceMappingURL=RequiredScripts.d.ts.map