require-head-tag-attributes-when-no-inner-html
Require top-level headTags entries without innerHTML to provide meaningful attributes.
Targeted pattern scopeโ
This rule targets docusaurus.config.* files and inspects the top-level headTags array.
What this rule reportsโ
This rule reports head-tag entries that do not provide non-empty innerHTML and also do not provide meaningful attributes.
Why this rule existsโ
A head-tag entry without attributes or inline content cannot produce meaningful output and usually indicates unfinished configuration.
โ Incorrectโ
export default {
headTags: [{ tagName: "meta" }],
};
โ Correctโ
export default {
headTags: [
{
tagName: "meta",
attributes: { name: "theme-color", content: "#25c2a0" },
},
],
};
Behavior and migration notesโ
This rule reports only. It does not autofix, because the missing attributes depend on author intent.
When not to use itโ
Do not use this rule if your project intentionally emits placeholder head-tag objects for later transformation.
Rule catalog ID: R077