Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upUTF-8 BOM causes error #283
Comments
dcousens
added
the
bug
label
Oct 9, 2015
This comment has been minimized.
This comment has been minimized.
|
Can you post a file we can use for reproduction? |
This comment has been minimized.
This comment has been minimized.
|
I can't attach any files for some reason, but here is the base64: I have no idea if the bom is preserved, but there is another way. In npm there is a tool called add-bom:
There is also another tool called strip-bom-cli that is invoked like this:
|
This comment has been minimized.
This comment has been minimized.
|
@feross I'm guessing this is an eslint issue? |
This comment has been minimized.
This comment has been minimized.
|
I believe this is a feature of the rule:
|
This comment has been minimized.
This comment has been minimized.
|
There's no need for a BOM character in a plaintext UTF-8 file. It's neither required, nor recommended by the Unicode spec. It appears there's an option to disable this behavior in Visual Studio: https://stackoverflow.com/questions/5406172/utf-8-without-bom |
feross
closed this
Oct 12, 2015
This comment has been minimized.
This comment has been minimized.
|
@Flet that'll teach me for not investigating what a BOM character is. |
dcousens
removed
the
bug
label
Oct 12, 2015
This comment has been minimized.
This comment has been minimized.
|
@dcousens Yeah, I hadn't heard of them before this either. |
beakdoctor commentedOct 8, 2015
I just noticed if you have a file with a UTF-8 BOM standard will throw an error like:
test2.js:1:1: Irregular whitespace not allowed
Is this intentional? Either way it's a confusing error because you can't actually see it visually. Also, Visual Studio apparently loves to add these to your files which will cause a lot of headaches along with this rule.