Skip to content

unicodeBOMs

Reports files with Unicode Byte Order Marks (BOMs).

✅ This rule is included in the ts stylistic preset.

The Unicode Byte Order Mark (BOM) is a special character (U+FEFF) that can appear at the start of a file to indicate its byte order and encoding. While it can be useful in some contexts, it is generally unnecessary in UTF-8 files and can cause issues with some tools and editors that do not expect it.

// File starts with BOM character (U+FEFF)
const value = 42;

This rule is not configurable.

If you are working in an environment that specifically requires UTF-8 files to have a BOM, you might choose to disable this rule. However, this is uncommon in modern development, as most tools and editors handle UTF-8 files without a BOM correctly.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.