/** * Configuration for validating that a script's body contains required substrings. * * @alpha */ export interface ScriptContainsRule { /** * The name of the script to validate. */ script: string; /** * Substrings that must appear in the script body. * All substrings must be present for the script to pass validation. */ mustContain: string[]; } /** * Configuration for the ScriptContains policy. * * @alpha */ export interface ScriptContainsConfig { /** * Rules for validating script body content. * * @example * ```typescript * rules: [ * { script: "clean", mustContain: ["rimraf"] }, * { script: "build", mustContain: ["tsc"] }, * ] * ``` */ rules: ScriptContainsRule[]; } /** * A policy that validates script bodies contain required substrings. * * @remarks * Use this policy to ensure specific scripts contain required commands or patterns * without requiring an exact match. For example, requiring that the "clean" script * uses "rimraf" or that "build" includes "tsc". * * The policy only validates scripts that exist. If a script doesn't exist, * it's not an error (use RequiredScripts for that). * * @example * ```typescript * import { policy } from "repopo"; * import { ScriptContains } from "repopo/policies"; * * policy(ScriptContains, { * rules: [ * { script: "clean", mustContain: ["rimraf"] }, * { script: "build", mustContain: ["tsc"] }, * { script: "test", mustContain: ["vitest", "run"] }, * ], * }) * ``` * * @alpha */ export declare const ScriptContains: import("../policy.js").PolicyShape; //# sourceMappingURL=ScriptContains.d.ts.map