require-license-file
Require a root-level license file.
Targeted pattern scopeâ
This rule checks the repository root for an explicit license file.
The rule accepts any of these filenames:
LICENSELICENSE.mdLICENSE.txt
What this rule reportsâ
This rule reports repositories that do not declare redistribution terms with an accepted license file.
Why this rule existsâ
If a repository does not publish a license file, consumers cannot easily tell what reuse, modification, or redistribution terms apply.
That uncertainty slows adoption and creates avoidable legal review work for downstream users.
â Incorrectâ
// Repository files
// .
// âââ README.md
// âââ eslint.config.mjs
// âââ package.json
//
// Missing: LICENSE, LICENSE.md, or LICENSE.txt
â Correctâ
// Repository files
// .
// âââ LICENSE
// âââ README.md
// âââ package.json
// Repository files
// .
// âââ LICENSE.md
// âââ README.md
// âââ 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-license-file": "error",
},
},
];
When not to use itâ
Disable this rule only if the repository is not intended for external reuse and your organization deliberately manages licensing out-of-band.
Rule catalog ID: R002