Skip to main content

no-html-links

Ensure that the Docusaurus <Link> component is used instead of <a> tags.

The <Link> component has prefetching and preloading built-in. また、ビルド時にリンク切れを検出し、Docusaurusがサイトの構造をより正確に把握できるよう支援します。

ルールの詳細

Examples of incorrect code for this rule:

<a href="/page">go to page!</a>

<a href="https://x.com/docusaurus" target="_blank">X</a>

Examples of correct code for this rule:

import Link from '@docusaurus/Link'

<Link to="/page">go to page!</Link>

<Link to="https://x.com/docusaurus">X</Link>

ルールの設定方法

Accepted fields:

オプションTypeDefault説明
ignoreFullyResolvedbooleanfalseSet to true will not report any <a> tags with absolute URLs including a protocol.