Skip to content

fix: conversion of LF to CRLF#56

Merged
bjohansebas merged 6 commits into
expressjs:mainfrom
mbtools:line-terminator
Jun 1, 2025
Merged

fix: conversion of LF to CRLF#56
bjohansebas merged 6 commits into
expressjs:mainfrom
mbtools:line-terminator

Conversation

@mbtools

@mbtools mbtools commented May 19, 2025

Copy link
Copy Markdown
Contributor

When running on Windows with a repo that uses LF as EOL, the codemod converts all LF to CRLF leading to unwanted diffs (diffs on 804 files in our Verdaccio repo).

This PR detects the EOL used in modified files and passes it as an option to jscodeshift (which will pass it to recast).

Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>

@bjohansebas bjohansebas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks for the PR! I’d like to know if you could try adding tests to verify the behavior, no problem if you can’t.

@mbtools

mbtools commented May 31, 2025

Copy link
Copy Markdown
Contributor Author

Vacation. In a couple weeks I can get to it ☀️🌴🌊

@mbtools

mbtools commented Jun 1, 2025

Copy link
Copy Markdown
Contributor Author

i found a minute and added some tests for the EOL detection. not sure if you want to do more for testing the transforms?

Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com>

@bjohansebas bjohansebas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@bjohansebas bjohansebas merged commit 56ceeb2 into expressjs:main Jun 1, 2025
23 checks passed
@bjohansebas bjohansebas mentioned this pull request Jun 1, 2025
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.

2 participants