跳到主要内容
版本:Canary 🚧

prefer-docusaurus-heading

确保使用 Docusaurus theme-classic提供的@theme/Heading主题组件代替<hn>标签作为标题。

规则的细节

该规则的错误代码示例:

<h1>This is heading 1</h1>

<h2>This is heading 2</h2>

<h3>This is heading 3</h3>

正确的代码示例:

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>