Skip to main content

docusaurus-recommended

docusaurusPluginConfigs["docusaurus-recommended"] is the default shareable config for this package.

Usageโ€‹

import { docusaurusPluginConfigs } from "stylelint-plugin-docusaurus";

export default docusaurusPluginConfigs["docusaurus-recommended"];

What it enablesโ€‹

This config registers the local plugin pack and enables the rules marked as recommended.

This config currently enables eight lower-noise baseline rules:

  • docusaurus/no-invalid-theme-custom-property-scope
  • docusaurus/no-mobile-navbar-backdrop-filter
  • docusaurus/no-subtree-data-theme-selectors
  • docusaurus/no-unwrapped-global-theme-selectors-in-css-modules
  • docusaurus/prefer-data-theme-color-mode
  • docusaurus/prefer-data-theme-over-prefers-color-scheme
  • docusaurus/require-html-prefix-for-docusaurus-data-attribute-selectors
  • docusaurus/require-local-anchor-for-global-theme-overrides-in-css-modules

Intended future roleโ€‹

As Docusaurus-specific rules are added, docusaurus-recommended should stay focused on low-noise, broadly applicable rules that are safe to enable in most Docusaurus codebases.

Rules in this configโ€‹

Fix legend: ๐Ÿ”ง = autofixable ยท โ€” = report only

RuleFixDescription
no-invalid-theme-custom-property-scopeโ€”Disallow declaring Docusaurus theme custom properties outside global theme scopes, except for DocSearch variables scoped to the DocSearch UI.
no-mobile-navbar-backdrop-filterโ€”Disallow backdrop-filter on Docusaurus navbar selectors unless it is guarded behind the desktop breakpoint.
no-subtree-data-theme-selectorsโ€”Disallow subtree-scoped data-theme selectors that do not start from the Docusaurus root color-mode attribute.
no-unwrapped-global-theme-selectors-in-css-modulesโ€”Disallow unwrapped Docusaurus and Infima global theme selectors inside CSS Modules.
prefer-data-theme-color-mode๐Ÿ”งPrefer Docusaurus data-theme selectors over legacy theme-dark/theme-light classes.
prefer-data-theme-over-prefers-color-schemeโ€”Prefer Docusaurus data-theme selector scopes over prefers-color-scheme media queries when styling Docusaurus theme tokens or global theme surfaces.
require-html-prefix-for-docusaurus-data-attribute-selectorsโ€”Require an html prefix for bare Docusaurus root data-attribute selectors that target global theme surfaces.
require-local-anchor-for-global-theme-overrides-in-css-modulesโ€”Require a local selector anchor when overriding Docusaurus global theme surfaces inside CSS Modules.