Skip to content

fix(codemod): prevent duplicate path when transforming lint scripts#92944

Open
Jah-yee wants to merge 1 commit intovercel:canaryfrom
Jah-yee:fix/codemod-extra-dot-path
Open

fix(codemod): prevent duplicate path when transforming lint scripts#92944
Jah-yee wants to merge 1 commit intovercel:canaryfrom
Jah-yee:fix/codemod-extra-dot-path

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 17, 2026

Good day,

Summary

Fixed the next-lint-to-eslint-cli codemod to avoid appending a duplicate . path when the original script already ends with ..

Root Cause

In packages/next-codemod/transforms/next-lint-to-eslint-cli.ts, the script transformation logic processes next lint --fix . and extracts . as a positional path argument. Then when building the result string, it adds all paths (including the .) followed by a separate default . when no paths are present. This results in eslint --fix . ..

Fix

Added a check to detect whether the paths array already contains . before appending the default. This ensures:

  • next linteslint . (default . added)
  • next lint --fix .eslint --fix . (no duplicate . added)

Testing

Verified locally with simulated test cases showing the fix works correctly for all edge cases.

…-pages rule

The no-html-link-for-pages ESLint rule was hardcoded to only recognize
.ts/.tsx/.js/.jsx page files. This commit makes it respect the
pageExtensions config from settings.next, allowing it to work with
custom file extensions like .mdx configured in next.config.js.

Fixes vercel#53473
@Jah-yee
Copy link
Copy Markdown
Author

Jah-yee commented Apr 17, 2026

Good day

Thank you for your attention. If there are any issues or suggestions, please leave a comment and I will address them promptly.

Warmly,
RoomWithOutRoof

@nextjs-bot
Copy link
Copy Markdown
Contributor

Allow CI Workflow Run

  • approve CI run for commit: 9afe25e

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.

2 participants