require-stylelint-extends-packages-installed
Require top-level Stylelint extends package specifiers to be listed in workspace dependencies.
Targeted pattern scopeโ
This rule targets Stylelint config modules such as stylelint.config.ts, stylelint.config.mjs, and .stylelintrc.js.
It focuses on top-level exported config objects, including configs wrapped in defineConfig(...).
What this rule reportsโ
Reports package-backed extends entries that do not resolve to a declared dependency in the nearest workspace package.json.
Why this rule existsโ
Shared Stylelint configs should reference installed packages explicitly. Missing dependency declarations create non-reproducible lint behavior across machines and CI jobs.
โ Incorrectโ
export default {
extends: ["stylelint-config-does-not-exist"],
rules: {},
};
โ Correctโ
export default {
extends: ["stylelint-config-standard"],
rules: {},
};
Behavior and migration notesโ
This rule reports unresolved package references and does not auto-fix because dependency installation strategy is repository-specific.
ESLint flat config exampleโ
import stylelint2 from "eslint-plugin-stylelint-2";
export default [stylelint2.configs.configuration];
When not to use itโ
Do not use this rule if your repository intentionally resolves extends packages through non-package-manager mechanisms.
Package documentationโ
Stylelint package documentation:
Rule catalog ID: R033