Core Concepts

Exclude Links

Last updated by
Harlan Wilton
in chore: lint.

Exclude URLs from inspection by adding them to the excludeLinks array.

Pattern Types

Exact Matches

export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/about',
      '/contact',
    ],
  },
})

Wildcards

Using radix3 route matching:

export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/admin/**', // All admin routes
      '/api/*', // Direct children only (/api/users, not /api/users/1)
      '/blog/*/comments', // Nested wildcards
    ],
  },
})

Regular Expressions

export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      /^\/blog\/\d+$/, // Blog posts with numeric IDs
      /\.(pdf|zip)$/, // File downloads
    ],
  },
})
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      'https://example.com/**',
      /^https:\/\/.*\.example\.com/,
    ],
  },
})

Common Use Cases

Exclude Dynamic Routes

If you have dynamic routes that aren't prerendered:

export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/user/**',
      '/products/**',
    ],
  },
})

Exclude Auth-Protected Routes

export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      '/dashboard/**',
      '/profile/**',
    ],
  },
})
export default defineNuxtConfig({
  linkChecker: {
    excludeLinks: [
      /#.*/, // All hash links
    ],
  },
})
Did this page help you?