Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): Handle formatting UTF-8 w/ BOM files #5881

Merged
merged 3 commits into from
May 28, 2020

Conversation

dsherret
Copy link
Member

Closes #5850.

if formatted_text != file_contents {
fs::write(&file_path, formatted_text)?;
if formatted_text != file_contents.text {
write_file_contents(
Copy link
Member Author

Choose a reason for hiding this comment

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

Should the BOM be stripped instead?

@dsherret dsherret changed the title fix(fmt): Handle formatting UTF-8 w/ BOM files fix(cli): Handle formatting UTF-8 w/ BOM files May 26, 2020
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

LGTM - thanks David!

@ry ry merged commit dc6c07e into denoland:master May 28, 2020
@dsherret dsherret deleted the deno_fmt_utf8_with_bom branch May 28, 2020 17:37
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Jun 5, 2020
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.

deno fmt - Formatting a file saved as UTF-8 with BOM leads to badly formatted text
2 participants