Skip to content

unicodeBOMs

Reports files with Unicode Byte Order Marks (BOMs).

✅ This rule is included in the ts stylistic and stylisticStrict presets.

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.

76// File starts with BOM character (U+FEFAEconsB0valAE <= sp ansty="le--0:#F78C6C;--1:#AA09">82<42sp ansty="le--0:#D6DEEB;--1:#403F">5<3;d ivclassNa="meco"><2;d>
6376// File without BOM chara44AEco61B0v44A09<8242 spans="tyle--0:#D6DEEB;--1:#40">3< 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.