npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-docusaurus-2

v2.0.4

Published

ESLint plugin for Docusaurus sites, docs repositories, and TypeDoc-integrated documentation workflows.

Readme

eslint-plugin-docusaurus-2

npm license. npm total downloads. latest GitHub release. GitHub stars. GitHub forks. GitHub open issues. codecov.


eslint-plugin-docusaurus-2 is an ESLint plugin for Docusaurus sites, docs repositories, and TypeDoc-integrated documentation workflows.

It ships focused Docusaurus-specific rules and Flat Config presets for teams that want stricter guarantees around:

  • docusaurus.config.*
  • theme config (navbar, footer, metadata, colorMode, announcement bars)
  • classic-theme global stylesheet configuration
  • search integrations (Algolia DocSearch and @easyops-cn/docusaurus-search-local)
  • package ownership checks for configured themes and search providers
  • analytics migrations and modern telemetry config
  • sidebars and docs navigation
  • pages, routing, and asset usage
  • plugin-pwa and docs-site integration details
  • JSX translation, framework link/heading usage, Markdown/MDX hygiene, and Docusaurus 3.10 strict-MDX migration
  • and more to come!

Table of contents

Installation

npm install --save-dev eslint-plugin-docusaurus-2 typescript

eslint-plugin-docusaurus-2 is published for broad public use. Install it into a workspace that already owns its ESLint and TypeScript toolchain.

Compatibility

  • ESLint: 9.x and 10.x
  • Config system: Flat Config only
  • Node.js: >=22
  • TypeScript: >=5.9

Quick start

import docusaurus2 from "eslint-plugin-docusaurus-2";

export default [docusaurus2.configs.recommended];

That is enough for the plugin to provide:

  • the docusaurus-2 plugin namespace
  • parser wiring through @typescript-eslint/parser
  • a stable Flat Config preset surface

Presets

This plugin currently exports six public presets:

| Preset | Purpose | | ----------------------------------------------------------------------------- | --------------------------------------------- | | 🟢 docusaurus2.configs.minimal | Smallest future-ready baseline. | | 🔵 docusaurus2.configs.config | Focused config/theme/plugin rule set. | | 🟡 docusaurus2.configs.recommended | Default starting point for most repositories. | | 🔴 docusaurus2.configs.strict | Stricter future tier for mature sites. | | 🟣 docusaurus2.configs.all | Every stable rule once the catalog grows. | | 🧪 docusaurus2.configs.experimental | Future experimental rule candidates. |

It also exports three opt-in configs that are intentionally kept outside the preset ladder:

| Config | Scope | Purpose | | ---------------------------------------------------------------------------------------- | -------------- | -------------------------------------------------------------------- | | 📝 docusaurus2.configs.content | *.md/*.mdx | Enable text/content-aware docs rules without touching JS/TS presets. | | 🌐 docusaurus2.configs.i18n | JS/TS/JSX/TSX | Enable both Docusaurus translation rules. | | 🧭 docusaurus2.configs["strict-mdx-upgrade"] | *.mdx | Enable the Docusaurus 3.10 strict-MDX syntax migration rules only. |

Additional opt-in configs

These are not part of the six preset tiers above.

Use them when you want focused translation or docs-content linting in addition to the normal JS/TS config presets.

import docusaurus2 from "eslint-plugin-docusaurus-2";

export default [docusaurus2.configs.recommended, docusaurus2.configs.content];

Enable both translation rules without adopting the full strict preset:

import docusaurus2 from "eslint-plugin-docusaurus-2";

export default [docusaurus2.configs.recommended, docusaurus2.configs.i18n];

If you only want the Docusaurus 3.10 strict-MDX migration rules, use the narrower config instead:

import docusaurus2 from "eslint-plugin-docusaurus-2";

export default [docusaurus2.configs["strict-mdx-upgrade"]];

Parser setup behavior

Every preset already includes:

  • files: ["**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts}"]
  • @typescript-eslint/parser
  • ecmaVersion: "latest"
  • sourceType: "module"
  • plugin registration under "docusaurus-2"

These opt-in content configs use the plugin's text-content parser instead of @typescript-eslint/parser:

  • docusaurus2.configs.content
  • docusaurus2.configs["strict-mdx-upgrade"]

The i18n config uses the normal TypeScript parser because it inspects JSX translation components and calls.

Plugin settings

import docusaurus2 from "eslint-plugin-docusaurus-2";

export default [
 {
  ...docusaurus2.configs.recommended,
  settings: {
   "docusaurus-2": {
    // Suppress plugin autofixes globally while preserving reports.
    // disableAllAutofixes: true,
   },
  },
 },
];

When settings["docusaurus-2"].disableAllAutofixes is true, rules still report diagnostics and suggestions, but direct autofixes are suppressed.

For stronger TypeDoc-specific linting around API doc authoring and TypeDoc conventions, pair this plugin with eslint-plugin-typedoc.

Rules

The current rule catalog focuses on Docusaurus config, validation, sidebar, and site-source CSS correctness.

The public preset surface is stable, and the rule catalog is intentionally focused while higher-value Docusaurus rule gaps are explored.

| Rule | Fix | Preset key | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---: | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | no-conflicting-config-link-content-props | — | 🔵 🟡 🔴 🟣 🧪 | | no-conflicting-config-link-props | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-conflicting-footer-html-item-props | — | 🔵 🟡 🔴 🟣 🧪 | | no-conflicting-navbar-doc-item-props | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-conflicting-navbar-doc-sidebar-item-props | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-conflicting-search-providers | — | 🔵 🟡 🔴 🟣 🧪 | | no-conflicting-theme-config-color-mode-flags | 🔧 | 🔵 🔴 🟣 🧪 | | no-conflicting-theme-config-metadata-keys | 💡 | 🔵 🔴 🟣 🧪 | | no-deprecated-future-experimental-faster | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-deprecated-future-experimental-storage | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-deprecated-google-analytics | 💡 | 🔵 🟡 🔴 🟣 🧪 | | no-deprecated-on-broken-markdown-links | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-duplicate-footer-column-titles | — | 🔵 🔴 🟣 🧪 | | no-duplicate-footer-link-item-destinations | 💡 | 🔵 🔴 🟣 🧪 | | no-duplicate-footer-link-item-labels | — | 🔵 🔴 🟣 🧪 | | no-duplicate-head-tags | 🔧 | 🔵 🔴 🟣 🧪 | | no-duplicate-i18n-locales | 🔧 💡 | 🔵 🔴 🟣 🧪 | | no-duplicate-navbar-item-destinations | 💡 | 🔵 🔴 🟣 🧪 | | no-duplicate-navbar-item-labels | — | 🔵 🔴 🟣 🧪 | | no-duplicate-plugin-pwa-head-tags | 🔧 | 🔵 🔴 🟣 🧪 | | no-duplicate-sidebar-doc-ids | 💡 | 🔴 🟣 🧪 | | no-duplicate-theme-classic-custom-css | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-duplicate-theme-config-metadata-keys | 🔧 | 🔵 🔴 🟣 🧪 | | no-empty-config-link-destinations | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-empty-config-link-labels | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-empty-footer-link-columns | 🔧 | 🔵 🔴 🟣 🧪 | | no-empty-footer-link-items | 🔧 | 🔵 🔴 🟣 🧪 | | no-empty-head-tags | 🔧 | 🔵 🔴 🟣 🧪 | | no-empty-navbar-dropdown-items | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-empty-navbar-item-objects | 🔧 | 🔵 🔴 🟣 🧪 | | no-empty-sidebar-categories | 🔧 | 🟡 🔴 🟣 🧪 | | no-empty-theme-classic-custom-css | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-empty-theme-config-metadata | 🔧 | 🔵 🔴 🟣 🧪 | | no-html-links | 💡 | 🟡 🔴 🟣 🧪 | | no-ignored-site-validations | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | no-mixed-sidebar-link-kinds | 💡 | 🔴 🟣 🧪 | | no-page-css-module-imports-in-components | — | 🔴 🟣 🧪 | | no-redundant-social-card-metadata | 🔧 | 🔵 🔴 🟣 🧪 | | no-search-link-without-search-provider | — | 🔵 🟡 🔴 🟣 🧪 | | no-search-page-link-when-search-page-disabled | — | 🔵 🟡 🔴 🟣 🧪 | | no-search-page-path-conflict | — | 🔵 🟡 🔴 🟣 🧪 | | no-svg-social-card-image | — | 🔵 🟡 🔴 🟣 🧪 | | no-unknown-i18n-locale-configs | — | 🔵 🟡 🔴 🟣 🧪 | | no-untranslated-text | — | 🔴 🟣 🧪 | | no-use-base-url-for-internal-link-components | 🔧 | 🟡 🔴 🟣 🧪 | | no-useless-collapsed-sidebar-categories | 🔧 | 🟡 🔴 🟣 🧪 | | prefer-config-satisfies | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | prefer-css-modules-in-site-src | — | 🔴 🟣 🧪 | | prefer-docusaurus-heading | 💡 | 🟡 🔴 🟣 🧪 | | prefer-head-tag-attributes-object | 🔧 | 🔵 🔴 🟣 🧪 | | prefer-href-for-external-link-components | 🔧 | 🟡 🔴 🟣 🧪 | | prefer-href-for-external-links | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | prefer-i18n-default-locale-first | 🔧 💡 | 🔵 🔴 🟣 🧪 | | prefer-sidebars-config-satisfies | 🔧 | 🟡 🔴 🟣 🧪 | | prefer-theme-config-docsearch | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | prefer-theme-config-metadata-name-for-twitter-tags | 🔧 | 🔵 🔴 🟣 🧪 | | prefer-theme-config-metadata-property-for-og-tags | 🔧 | 🔵 🔴 🟣 🧪 | | prefer-to-for-internal-link-components | 🔧 | 🟡 🔴 🟣 🧪 | | prefer-to-for-internal-links | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | prefer-use-base-url-for-static-assets | 💡 | 🔴 🟣 🧪 | | require-balanced-footer-link-columns | — | 🧪 | | require-base-url-issue-banner-enabled | 🔧 | 🔵 🔴 🟣 🧪 | | require-base-url-slashes | 🔧 | 🔵 🔴 🟣 🧪 | | require-config-link-content | — | 🔵 🟡 🔴 🟣 🧪 | | require-config-link-destination | — | 🔵 🟡 🔴 🟣 🧪 | | require-default-export-pages | — | 🔴 🟣 🧪 | | require-doc-sidebar-link-type | 🔧 | 🟡 🔴 🟣 🧪 | | require-docsearch-ask-ai-assistant-id | — | 🔵 🟡 🔴 🟣 🧪 | | require-docsearch-theme-when-configured | — | 🔵 🟡 🔴 🟣 🧪 | | require-docusaurus-faster-package-installed | — | 🔵 🟡 🔴 🟣 🧪 | | require-footer-link-column-items | — | 🔵 🟡 🔴 🟣 🧪 | | require-footer-link-column-title | — | 🔵 🟡 🔴 🟣 🧪 | | require-generated-index-link-type | 🔧 | 🟡 🔴 🟣 🧪 | | require-head-tag-attributes-when-no-inner-html | — | 🔵 🔴 🟣 🧪 | | require-head-tag-content-or-attributes | — | 🔵 🔴 🟣 🧪 | | require-head-tag-tag-name | 💡 | 🔵 🔴 🟣 🧪 | | require-i18n-default-locale-in-locales | 🔧 💡 | 🔵 🔴 🟣 🧪 | | require-markdown-format-detect | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | require-markdown-mermaid-when-theme-mermaid-enabled | 🔧 | 🔵 🟡 🔴 🟣 🧪 | | require-navbar-doc-item-doc-id | — | 🔵 🟡 🔴 🟣 🧪 | | require-navbar-doc-sidebar-item-sidebar-id | — | 🔵 🟡 🔴 🟣 🧪 | | require-navbar-docs-version-item-to | — | [🔵](https://nick2bad4u.github.io/eslint-plugin-docusaurus-2