Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

missing whitespace for file with BOM(UTF-8) #2506

Closed
NikitaEgorov opened this issue Apr 5, 2017 · 5 comments
Closed

missing whitespace for file with BOM(UTF-8) #2506

NikitaEgorov opened this issue Apr 5, 2017 · 5 comments

Comments

@NikitaEgorov
Copy link

Bug Report

  • 4.5.1:
  • 2.2.2:
  • Node.js API

TypeScript code being linted

[BOM]import * as $t from 't';

with tslint.json configuration:

"whitespace": [
      true,
      "check-branch",
      "check-decl",
      "check-operator",
      "check-module",
      "check-separator",
      "check-type",
      "check-typecast"
    ]

Actual behavior

.ts[1, 2]: missing whitespace

Expected behavior

No error

@stogle
Copy link

stogle commented Apr 10, 2017

I have a similar issue with UTF-8 + BOM encoded files and tslint.json configuration:

"align": [
    true,
    "statements"
]

Actual behaviour

.ts[2, 1]: statements are not aligned
.ts[3, 1]: statements are not aligned
etc.

(reported for every statement in the file that is at the beginning of a line)

Expected behavior

No error

@flash-me
Copy link

flash-me commented Apr 19, 2017

We have same whitespace issues with files having utf-8 with BOM encoding.
Its the check-module argument which causes this.

@kristho91
Copy link

We have the same problem with the whitespace rule, it's the "check-typecast" option that is the cause.
I think the problem is for everyone using Visual Studio (and maybe others).

We use tslint: 5.3.2 and TypeScript 2.3.3.

@KevinFernandes
Copy link

We are also having a similar issue with files that were edited in Visual Studio. The files are in UTF8-BOM format. With tslint 5.2.0 they lint without issue but with 5.3.2 we get a "missing whitespace" error on line [1,2] for every file. If we edit the file to remove the BOM then tslint is happy again. I seem to remember something like this happening before so this might be some sort or regression.

@KevinFernandes
Copy link

Is there any update on this issue? As of 5.5.0 it still appears to be a problem. Or if someone knows of a way to get Visual Studio 2017 to save without the BOM that would work too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants