Skip to content

fix(eslint-plugin-next): respect pageExtensions in no-html-link-for-pages (#53473) - #96993

Open
arts009009009 wants to merge 1 commit into
vercel:canaryfrom
arts009009009:fix-eslint-pageExtensions
Open

fix(eslint-plugin-next): respect pageExtensions in no-html-link-for-pages (#53473)#96993
arts009009009 wants to merge 1 commit into
vercel:canaryfrom
arts009009009:fix-eslint-pageExtensions

Conversation

@arts009009009

Copy link
Copy Markdown

Summary

The ESLint rule @next/next/no-html-link-for-pages was ignoring files with custom extensions (e.g. .page.tsx) when pageExtensions was configured. This PR updates the rule to correctly respect the pageExtensions option.

Reproduction

  • Config: .eslintrc.cjs with pageExtensions: ["page.tsx"]
  • Fixture: tests/pageExtensions/about.page.tsx
  • Before: ESLint produced no error for
  • After: ESLint correctly flags and suggests using

Implementation

  • Updated rule logic in no-html-link-for-pages.ts to check pageExtensions.
  • Added test fixtures under tests/pageExtensions to confirm behavior.

Tests

  • Verified that .page.tsx files are now linted.
  • Confirmed existing behavior for default .js/.jsx/.ts/.tsx extensions remains unchanged.

Closes #53473

type: 'string',
},
{
type: 'object',

Copy link
Copy Markdown
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 rule's option schema was narrowed to object-only, so ESLint schema validation rejects the previously-supported string and array-of-strings options before create() runs, throwing an "invalid configuration" error.

Fix on Vercel

@sirgagahandino9-design sirgagahandino9-design left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

best

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

2 participants