Skip to content

Fix no-html-link-for-pages rule to respect custom pageExtensions - #96953

Open
ecryptoguru wants to merge 1 commit into
vercel:canaryfrom
ecryptoguru:fix/no-html-link-for-pages-page-extensions
Open

Fix no-html-link-for-pages rule to respect custom pageExtensions#96953
ecryptoguru wants to merge 1 commit into
vercel:canaryfrom
ecryptoguru:fix/no-html-link-for-pages-page-extensions

Conversation

@ecryptoguru

Copy link
Copy Markdown

Summary

Fixes #53473

The no-html-link-for-pages ESLint rule was not accounting for custom pageExtensions configured in next.config.js. When users configured non-default extensions (e.g. .page.tsx), the rule would either miss valid pages or incorrectly flag links as violations.

The `no-html-link-for-pages` ESLint rule was not accounting for custom
`pageExtensions` configured in `next.config.js`. When users configured
non-default extensions (e.g. `.page.tsx`), the rule would either miss
valid pages or incorrectly flag links as violations.

This change:
- Reads `pageExtensions` from ESLint settings and passes it through
  to the page/app directory resolution logic in `url.ts`
- Updates `isTargetPage` and related helpers to match files using
  the configured extensions instead of hardcoding `.tsx`/`.ts`/etc.
- Adds test fixtures and test cases covering custom `pageExtensions`
  for both `pages/` and `app/` directories

Closes vercel#53473

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

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

1 participant