no-html-links
Ensure that the Docusaurus <Link>
component is used instead of <a>
tags.
The <Link>
component has prefetching and preloading built-in. Il permet également de détecter les liens brisés en temps réel et aide Docusaurus à mieux comprendre la structure de votre site.
Rule Details
Examples of incorrect code for this rule:
<a href="/page">go to page!</a>
<a href="https://twitter.com/docusaurus" target="_blank">Twitter</a>
Examples of correct code for this rule:
import Link from '@docusaurus/Link'
<Link to="/page">go to page!</Link>
<Link to="https://twitter.com/docusaurus">Twitter</Link>
Rule Configuration
Champs acceptés :
Option | Type | Par défaut | Description |
---|---|---|---|
ignoreFullyResolved | boolean | false | Set to true will not report any <a> tags with absolute URLs including a protocol. |