require-plugin-pwa-head-theme-color
Require plugin-pwa pwaHead to include a theme-color meta tag.
Targeted pattern scopeβ
This rule focuses on docusaurus.config.* files when @docusaurus/plugin-pwa is configured in the top-level plugins array.
It expects the plugin-pwa options object to include a pwaHead entry with a theme-color meta tag.
What this rule reportsβ
This rule reports plugin-pwa setups that do not provide a theme-color meta tag in pwaHead.
Why this rule existsβ
The Docusaurus PWA docs list a theme-color meta tag as part of the minimal head setup for a PWA-compliant site.
When plugin-pwa is enabled but the theme-color tag is missing, the configuration no longer matches the documented PWA head setup that browsers use for installation and chrome theming.
β Incorrectβ
export default {
plugins: [
[
"@docusaurus/plugin-pwa",
{
pwaHead: [
{
tagName: "link",
rel: "manifest",
href: "/manifest.json",
},
],
},
],
],
};
β Correctβ
export default {
plugins: [
[
"@docusaurus/plugin-pwa",
{
pwaHead: [
{
tagName: "meta",
name: "theme-color",
content: "#25c2a0",
},
],
},
],
],
};
Behavior and migration notesβ
This rule reports only. It does not autofix.
The right theme color depends on the siteβs branding and PWA design choices, so a fixer should not invent one.
When not to use itβ
Do not use this rule if your project intentionally configures plugin-pwa without a theme-color tag or you do not want linting to enforce the documented Docusaurus PWA head setup.
Rule catalog ID: R043