disallow-secretlint-empty-rule-id
Disallow empty rule id keeps secretlint configuration files predictable when they are reviewed beside ESLint configuration.
Rule catalog ID: R002
Targeted pattern scopeโ
This rule targets Secretlint content and Secretlint configuration. Use it in repositories where ESLint is the central feedback surface for local development, CI, and editor diagnostics.
Matched patternsโ
- Files matched by the bridge rule or the configuration preset that enables
secretlint/disallow-secretlint-empty-rule-id. - .secretlintrc.json and related secretlint configuration documents.
Detection boundariesโ
The rule does not reimplement the full Secretlint configuration language. It validates the bridge-facing behavior that ESLint can report reliably and leaves deeper domain checks to Secretlint.
What this rule reportsโ
The rule reports empty arrays, empty objects, or blank pattern lists that look intentional but do not configure useful secretlint behavior.
Why this rule existsโ
Bridge plugins are useful only when they preserve upstream behavior and keep configuration reviewable. This rule keeps secretlint feedback close to ESLint without forcing users to copy an entire upstream config into ESLint options.
โ Incorrectโ
{ "rules": { "@secretlint/secretlint-rule-preset-recommend": true } }
โ Correctโ
{ "rules": [{ "id": "@secretlint/secretlint-rule-preset-recommend" }] }
Behavior and migration notesโ
Start with the recommended preset when adopting the plugin. Move project-specific secretlint options into the upstream config file and keep ESLint options limited to file selection, config path, and bridge behavior.
Additional examplesโ
import secretlint from "eslint-plugin-secretlint";
export default [
secretlint.configs.recommended,
{
rules: {
"secretlint/disallow-secretlint-empty-rule-id": "error",
},
},
];
ESLint flat config exampleโ
import secretlint from "eslint-plugin-secretlint";
export default [secretlint.configs.recommended];
When not to use itโ
Do not enable this rule when Secretlint is intentionally run outside ESLint and duplicate editor or CI diagnostics would slow the project down.
Package documentationโ
eslint-plugin-secretlint package documentation:
Further readingโ
Adoption resourcesโ
- Enable the recommended preset first.
- Keep upstream configuration in
.secretlintrc.jsonunless a rule option explicitly asks for a different file. - Run
npm run lint:remarkbefore publishing docs changes so heading drift is caught locally.