Skip to main content

require-dependabot-package-ecosystem

Rule catalog ID: R072

Targeted pattern scopeโ€‹

Entries under the top-level updates sequence in Dependabot configuration files.

What this rule reportsโ€‹

This rule reports updates entries that are not mappings, or mappings that omit a non-empty package-ecosystem.

Why this rule existsโ€‹

Dependabot cannot resolve package-manager-specific behavior without knowing the ecosystem for each update block. Missing package-ecosystem means the rest of the block has no clear target.

โŒ Incorrectโ€‹

version: 2
updates:
- directory: "/"
schedule:
interval: "weekly"

โœ… Correctโ€‹

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"

Additional examplesโ€‹

This rule is especially helpful when large updates blocks are copied and edited by hand, since missing package-ecosystem is easy to overlook in repetitive YAML.

ESLint flat config exampleโ€‹

import githubActions from "eslint-plugin-github-actions-2";

export default [githubActions.configs.dependabot];

When not to use itโ€‹

If you already validate Dependabot files against a stricter schema elsewhere, this rule can be redundant.

Further readingโ€‹