Skip to content

deno fmt - remove UTF-8 BOM instead of maintaining it #29790

@dsherret

Description

@dsherret

We should remove the UTF-8 BOM in deno fmt. It's bad to have in the file because it causes some overhead. Right now it causes an additional allocation in order to strip the BOM and also it causes the loaded text to differ from the bytes, which may cause slight memory increase in some cases (ex. with the new text imports)

Right now it preserves it:

file_contents.text.insert(0, '\u{FEFF}');

Metadata

Metadata

Assignees

No one assigned

    Labels

    deno fmtRelated to the "deno fmt" subcommand or dprintgood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions