Skip to main content

no-deprecated-admonition-title-syntax

Disallow deprecated :::type Title admonition titles in .mdx files and prefer bracket syntax for Docusaurus 3.10 strict MDX migration.

Targeted pattern scopeโ€‹

This rule focuses on .mdx content files.

It reports admonition openings that still use the legacy title form:

  • :::warning Pay Attention
  • :::note Read this first

What this rule reportsโ€‹

This rule reports deprecated admonition title syntax in .mdx files and expects the bracket form:

  • :::warning[Pay Attention]

Why this rule existsโ€‹

Docusaurus 3.10 recommends migrating admonition titles to bracket syntax so content aligns better with the broader Markdown directive ecosystem.

That syntax is more portable and less tied to the older proprietary Docusaurus shorthand.

โŒ Incorrectโ€‹

:::warning Pay Attention
Read this first.
:::

โœ… Correctโ€‹

:::warning[Pay Attention]
Read this first.
:::

Behavior and migration notesโ€‹

This rule autofixes legacy admonition titles to bracket syntax in .mdx files.

It intentionally ignores fenced code blocks so code samples and migration examples remain untouched.

ESLint flat config exampleโ€‹

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

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

When not to use itโ€‹

Do not use this rule if your project is deliberately keeping the old admonition-title form during a staged migration.

Rule catalog ID: R116

Further readingโ€‹