PackageReadme
constPackageReadme:FilePolicyDefinition<PackageReadmeSettings|undefined>
Defined in: policies/PackageReadme.ts:243
A repo policy that ensures each package has a README.md file with proper content.
Remarks
Section titled “Remarks”This policy validates that packages have documentation and can enforce:
- README.md file exists
- README title matches the package name
- README contains required content (e.g., trademark notices)
The policy supports auto-fixing by creating a basic README with the package name as title.
Example
Section titled “Example”import { makePolicy } from "repopo";import { PackageReadme } from "repopo/policies";
const config: RepopoConfig = { policies: [ // Basic README validation makePolicy(PackageReadme, { instanceId: "readme" }),
// Require trademark notice in all READMEs makePolicy(PackageReadme, { instanceId: "readme-trademark", config: { requiredContent: "## Trademark" }, }), ],};