Skip to content

Conversation

@SunnyXilon
Copy link

Fixes #53473

This change updates the no-html-link-for-pages ESLint rule to correctly
handle custom pageExtensions such as *.page.tsx by avoiding hardcoded
file extension assumptions.

Added test coverage to ensure the rule warns correctly for pages using
custom extensions.

Note: Local Jest execution for this rule can be limited on Windows due
to the Next.js repo test setup; CI should validate the change.

* Recursively parse directory for page URLs.
*/
function parseUrlForPages(urlprefix: string, directory: string) {
const extensions = ['js', 'jsx', 'ts', 'tsx']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The no-html-link-for-pages ESLint rule doesn't respect custom pageExtensions from Next.js config, causing files with compound extensions like test.page.tsx to have incorrect URLs (e.g., /test.page/ instead of /test/)

Fix on Vercel

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