require-codeowners-reviewable-patterns
Require all CODEOWNERS patterns to have at least one owner assigned.
Targeted pattern scopeâ
This rule reads the CODEOWNERS file (checked in .github/CODEOWNERS,
.gitlab/CODEOWNERS, .bitbucket/CODEOWNERS, CODEOWNERS, or
docs/CODEOWNERS) and parses each non-comment line, reporting any pattern that
is followed by no owner entries.
What this rule reportsâ
This rule reports CODEOWNERS lines that declare a file-path pattern but list no owners, rendering the pattern unenforceable.
Why this rule existsâ
GitHub and GitLab enforce CODEOWNERS patterns only when they contain at least one valid owner. A pattern with no owners is silently ignored by the platform â it does not block merges and does not request reviews. This creates a false sense of coverage in the review process. Keeping every pattern reviewable ensures the intent of the CODEOWNERS file matches its runtime behaviour.
â Incorrectâ
# CODEOWNERS
*.ts # no owner â pattern is silently ignored
docs/ @docs-team
*.md # another unowned pattern
â Correctâ
# CODEOWNERS
*.ts @team/typescript-owners
docs/ @docs-team
*.md @docs-team
ESLint flat config exampleâ
import repoPlugin from "eslint-plugin-repo";
export default [
repoPlugin.configs.recommended,
{
plugins: { "repo-compliance": repoPlugin },
rules: {
"repo-compliance/require-codeowners-reviewable-patterns": "warn",
},
},
];
When not to use itâ
Disable this rule if your workflow intentionally uses blank-owner CODEOWNERS lines as placeholders during migration, and you have a separate process to fill them in before merging.
Rule catalog ID: R047