vercel / vercel/next.js

[next-codemod] codemod changes all line endings to carriage returns on windows

Open
#42,437 3 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Verify canary release
  • I verified that the issue exists in the latest Next.js canary release
Provide environment information

Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.12.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.0.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

Running either of the following commands on windows results in all newlines in all files to be changed to carriage returns.

$ npx @next/codemod@latest new-link
$ npx @next/codemod@canary new-link
image
Expected Behavior

Running codemod does not alter line endings one way or the other.

Link to reproduction

This can be reproduced in any project, but only on Windows

To Reproduce

Run npx @next/codemod@latest new-link on Windows.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on Windows with npx @next/codemod@latest new-link or the canary version, then trace the new-link codemod entry point. Done means the codemod changes the intended content without changing line endings in project files.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nextjs
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.