mirror of
https://github.com/facebook/docusaurus.git
synced 2025-12-26 01:33:02 +00:00
Some checks failed
Argos CI / take-screenshots (push) Has been cancelled
Build Hash Router / Build Hash Router (push) Has been cancelled
Canary Release / Publish Canary (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Continuous Releases / Continuous Releases (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (18.0) (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (20) (push) Has been cancelled
E2E Tests / E2E — Yarn v1 (22) (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (node-modules, -s) (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (node-modules, -st) (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (pnp, -s) (push) Has been cancelled
E2E Tests / E2E — Yarn Berry (pnp, -st) (push) Has been cancelled
E2E Tests / E2E — npm (push) Has been cancelled
E2E Tests / E2E — pnpm (push) Has been cancelled
32 lines
684 B
Plaintext
32 lines
684 B
Plaintext
---
|
|
slug: /api/misc/@docusaurus/eslint-plugin/prefer-docusaurus-heading
|
|
---
|
|
|
|
# prefer-docusaurus-heading
|
|
|
|
Ensures that the `@theme/Heading` theme component provided by Docusaurus [`theme-classic`](../../themes/theme-classic.mdx) is used instead of `<hn>` tags for headings.
|
|
|
|
## Rule Details {#details}
|
|
|
|
Examples of **incorrect** code for this rule:
|
|
|
|
```html
|
|
<h1>This is heading 1</h1>
|
|
|
|
<h2>This is heading 2</h2>
|
|
|
|
<h3>This is heading 3</h3>
|
|
```
|
|
|
|
Examples of **correct** code for this rule:
|
|
|
|
```javascript
|
|
import Heading from '@theme/Heading'
|
|
|
|
<Heading as='h1'>This is heading 1</Heading>
|
|
|
|
<Heading as='h2'>This is heading 2</Heading>
|
|
|
|
<Heading as='h3'>This is heading 3</Heading>
|
|
```
|