Skip to content

Conversation

@malkovitc
Copy link

Summary

Add support for custom pageExtensions option in the no-html-link-for-pages ESLint rule. This allows projects using custom page extensions (e.g., .page.tsx, .page.ts) to properly detect internal routes.

Changes

  • Add pageExtensions option to rule schema
  • Update url.ts to accept pageExtensions parameter
  • Create dynamic regex patterns based on provided extensions
  • Add tests for custom page extensions

Usage

// .eslintrc.js
module.exports = {
  rules: {
    '@next/next/no-html-link-for-pages': [
      'error',
      {
        pagesDir: 'src/pages',
        pageExtensions: ['page.tsx', 'page.ts', 'page.jsx', 'page.js']
      }
    ]
  }
}

How tested

  • Added 3 new test cases for custom page extensions
  • All 26 tests pass

Fixes #53473

Add support for custom pageExtensions option in the no-html-link-for-pages
ESLint rule. This allows projects using custom page extensions (e.g.,
.page.tsx, .page.ts) to properly detect internal routes.

Changes:
- Add pageExtensions option to rule schema
- Update url.ts to accept pageExtensions parameter
- Create dynamic regex patterns based on provided extensions
- Add tests for custom page extensions

Fixes vercel#53473
@nextjs-bot
Copy link
Collaborator

Allow CI Workflow Run

  • approve CI run for commit: 0a3f4ef

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

1 similar comment
@nextjs-bot
Copy link
Collaborator

Allow CI Workflow Run

  • approve CI run for commit: 0a3f4ef

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@next/next/no-html-link-for-pages rule does not work with pageExtensions

2 participants