-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add docs for prefer-docusaurus-heading rule
Signed-off-by: Devansu <devansuyadav@gmail.com>
- Loading branch information
1 parent
199da9c
commit e351bf9
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
website/docs/api/misc/eslint-plugin/prefer-docusaurus-heading.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
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.md) 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> | ||
``` |