require-readme-file
Require a root-level README for the repository.
Targeted pattern scopeâ
This rule checks the repository root for a primary README document.
The rule accepts either of these files:
README.mdREADME
What this rule reportsâ
This rule reports repositories that do not provide any accepted README file at the root.
Why this rule existsâ
A repository without a README forces contributors, users, and maintainers to guess basic project context.
Even a short README gives reviewers and automation consumers a stable place to find:
- project purpose
- setup or usage notes
- contribution expectations
- links to deeper documentation
â Incorrectâ
// Repository files
// .
// âââ eslint.config.mjs
// âââ package.json
// âââ src/
//
// Missing: README.md or README
â Correctâ
// Repository files
// .
// âââ README.md
// âââ eslint.config.mjs
// âââ package.json
// Repository files
// .
// âââ README
// âââ eslint.config.mjs
// âââ package.json
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.recommended,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-readme-file": "error",
},
},
];
When not to use itâ
Disable this rule only if the repository is intentionally private, ephemeral, or generated and you do not want a root-level landing document.
Rule catalog ID: R001