Inspection Rules
Available Rules
Rules are based on the URL structure best practices for Google.
Rule | Description |
---|---|
Checks for absolute links that are internal. | |
Ensures link text is descriptive and meaningful. | |
Checks for missing hashes in internal links. | |
Checks for document relative links. | |
Checks for double slashes in URLs. | |
Checks for duplicate query parameters in URLs. | |
Checks for error responses (4xx, 5xx) on internal links. | |
Checks for JavaScript links. | |
Ensures that | |
Checks for non-ASCII characters. | |
Checks for underscores. | |
Checks for uppercase characters. | |
Checks for whitespace. | |
Checks 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>
<NuxtLink to="/about">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'absolute-site-urls'
],
},
})
link-text
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 includes link text such as "my page" or "Read more".
<NuxtLink to="/about">click here</NuxtLink>
<NuxtLink to="/about">About</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'link-text'
],
},
})
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>
<div id="valid"></div>
<NuxtLink to="#valid">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'missing-hash'
],
},
})
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>
<NuxtLink to="/link">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-baseless'
],
},
})
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>
<NuxtLink to="/link/">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-double-slashes'
],
},
})
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¶m=2">my page</NuxtLink>
<NuxtLink to="/link?param=1">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-duplicate-query-params'
],
},
})
no-error-response
Checks for error responses (4xx, 5xx) on internal links.
Ensuring that internal links do not lead to error responses improves the user experience and imporoves your sites crawlablity.
Note: This does not scan external links due to unpredictable network conditions.
<NuxtLink to="/broken-link">my page</NuxtLink>
<NuxtLink to="/valid-link">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-error-response'
],
},
})
no-javascript
Checks for JavaScript links.
JavaScript links provide poor user experience as they override the default browser behaviour.
It's recommended to use a
<a href="javascript:doSomething()">my page</a>
<button type="button" @click="doSomething()">my page</button>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-javascript'
],
},
})
no-missing-href
Ensures that links have an
Having an
<a>my page</a>
<a href="/link">my page</a>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-missing-href'
],
},
})
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>
<NuxtLink to="/my-page">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-non-ascii-chars'
],
},
})
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>
<NuxtLink to="/my-page">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-underscores'
],
},
})
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>
<NuxtLink to="/my-page">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-uppercase-chars'
],
},
})
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>
<NuxtLink to="/my-page">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'no-whitespace'
],
},
})
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.
<NuxtLink to="/my-page/">my page</NuxtLink>
<NuxtLink to="/my-page">my page</NuxtLink>
export default defineNuxtConfig({
linkChecker: {
skipInspections: [
'trailing-slash'
],
},
})