Index of every page on this site: llms.txt

Inspection Rules

The module runs 15 inspections covering broken links, SEO best practices, and accessibility. To disable any rule, add it to skipInspections in your config.

Rule Categories

CategoryRules
Broken Linksno-error-response, missing-hash, redirects
SEOno-uppercase-chars, no-underscores, trailing-slash, no-whitespace, no-non-ascii-chars
URL Structureabsolute-site-urls, no-baseless, no-double-slashes, no-duplicate-query-params
Accessibilitylink-text, no-missing-href, no-javascript

Disabling Rules

To disable any rule, add it to skipInspections:

export default defineNuxtConfig({
  linkChecker: {
    skipInspections: ['rule-name']
  }
})

Available Rules

Rules are based on the URL structure best practices for Google.

RuleDescription
absolute-site-urlsChecks for absolute links that are internal.
link-textEnsures link text is descriptive and meaningful.
missing-hashChecks for missing hashes in internal links.
no-baselessChecks for document relative links.
no-double-slashesChecks for double slashes in URLs.
no-duplicate-query-paramsChecks for duplicate query parameters in URLs.
no-error-responseChecks for error responses (4xx, 5xx) on links.
no-javascriptChecks for JavaScript links.
no-missing-hrefEnsures that a tags have an href attribute.
no-non-ascii-charsChecks for non-ASCII characters.
no-underscoresChecks for underscores.
no-uppercase-charsChecks for uppercase characters.
no-whitespaceChecks for whitespace.
redirectsWarns when links respond with a redirect.
trailing-slashChecks for trailing slashes on internal links.

absolute-site-urls

Checks for absolute links that are internal

Using relative paths is recommended as it makes your site more portable and easier to maintain.

<NuxtLink to="https://example.com/about">my page</NuxtLink>

Ensures link text is descriptive and meaningful.

Descriptive link text provide improved accessibility, allowing screen readers to better understand the context of the link. It flags non-descriptive link text such as "click here", "click this", "this", "learn more", "go", "here", "start", "right here", "more", and similar.

<NuxtLink to="/about">click here</NuxtLink>

missing-hash

Checks for missing Document Fragments for internal links.

Having valid hashes ensures that users are navigated to the correct section of the page, improving the user experience and accessibility.

<div id="valid-anchor"></div>
<NuxtLink to="#valid">my page</NuxtLink>

no-baseless

Document relative links are valid but can cause SEO maintenance issues when moving around your content.

It's recommended to use root relative links to avoid these issues.

<NuxtLink to="link">my page</NuxtLink>

no-double-slashes

Checks for double slashes in URLs.

Double slashes in URLs can cause canonicalization issues and can lead to duplicate content.

<NuxtLink to="/link//">my page</NuxtLink>

no-duplicate-query-params

Checks for duplicate query parameters in URLs.

Duplicate query parameters can cause issues with caching and can lead to duplicate content.

<NuxtLink to="/link?param=1&param=2">my page</NuxtLink>

no-error-response

Checks for error responses (4xx, 5xx) on links.

Ensuring that links do not lead to error responses improves the user experience and improves your sites crawlability. For internal links, the module will suggest similar pages when it finds a match. Checking external links requires fetchRemoteUrls: true.

<NuxtLink to="/broken-link">my page</NuxtLink>

no-javascript

Checks for JavaScript links.

JavaScript links provide poor user experience as they override the default browser behavior.

It's recommended to use a <button type="button"> if you need an on click event.

<a href="javascript:doSomething()">my page</a>

no-missing-href

Ensures that links have an href attribute.

Links need an href attribute for accessibility and usability. If you need an anchor that doesn't navigate, use a <button> instead or the role="button" attribute.

<a>my page</a>

no-non-ascii-chars

Checks for non-ASCII characters in URLs.

Non-ASCII characters can cause issues with encoding and can lead to broken links.

<NuxtLink to="/my-ページ">my page</NuxtLink>

no-underscores

Checks for underscores in URLs.

Underscores are not recommended in URLs as they can cause issues with readability and SEO.

<NuxtLink to="/my_page">my page</NuxtLink>

no-uppercase-chars

Checks for uppercase characters in URLs.

Uppercase characters are not recommended in URLs as they can cause issues with readability and SEO.

<NuxtLink to="/MyPage">my page</NuxtLink>

no-whitespace

Checks for whitespace in URLs.

Whitespace in URLs can cause issues with encoding and can lead to broken links.

<NuxtLink to="/my page">my page</NuxtLink>

redirects

Warns when a link responds with a redirect: 301, 302, 303, 307 or 308. The suggested fix is the Location target.

The rule runs in development and in the build scan. A redirect from routeRules or from a server middleware counts.

Redirects use up your crawl budget and increase loading times. It's recommended to link directly to the final URL when possible.

<!-- Links to a URL that redirects to /new-page -->
<NuxtLink to="/old-page">my page</NuxtLink>

trailing-slash

Checks that internal links all either have or don't have a trailing slash depending on your configuration.

Inconsistent trailing slashes can cause issues with canonicalization and can lead to duplicate content.

The behavior depends on the siteConfig.trailingSlash setting. The example below assumes the default setting, with trailing slashes disabled.

<!-- trailing slashes disabled (default) -->
<NuxtLink to="/my-page/">my page</NuxtLink>

A directory index in public/ always takes a trailing slash, whatever siteConfig.trailingSlash says. For public/demo/index.html, link to /demo/. The page resolves its relative assets against /demo/, and most static hosts redirect /demo/index.html to /demo/.

If nitro.prerender.crawlLinks is on, the crawler renders /demo/ as a Nuxt page and fails with a 404. To skip it, add '/demo/**': { prerender: false } to routeRules.

Was this page helpful?