Skip to main content

no-empty-theme-config-metadata

Disallow themeConfig.metadata arrays that are statically empty.

Targeted pattern scopeโ€‹

This rule targets docusaurus.config.* files and inspects themeConfig.metadata.

What this rule reportsโ€‹

This rule reports themeConfig.metadata when it resolves statically to an empty array.

Why this rule existsโ€‹

An empty metadata array adds noise without contributing any head metadata and often indicates unfinished or left-over configuration.

โŒ Incorrectโ€‹

export default {
themeConfig: {
metadata: [],
},
};

โœ… Correctโ€‹

export default {
themeConfig: {
metadata: [{ name: "keywords", content: "docs" }],
},
};

Behavior and migration notesโ€‹

This rule autofixes by removing empty themeConfig.metadata properties.

When not to use itโ€‹

Do not use this rule if empty metadata arrays are intentionally emitted for a later transform step.

Rule catalog ID: R069

Further readingโ€‹