angular2, file should end with a newline, and trailing space

user1034127 picture user1034127 · Oct 19, 2016 · Viewed 15.1k times · Source

I am new to angular2 and typescript, I got this 3 errors, I don't understand how to fix trailing whitespace and file should end with a newline.

enter image description here

Answer

Hans Tiono picture Hans Tiono · May 20, 2017

The errors come from tslint which defines some rules on your project and check if your code matches the rules. You need to either fix the error or ignore/disable those rules.

file should end with a newline

You can ignore this rule on tslint.json by adding this on the rules object property

 "eofline": false

-

trailing whitespace

You can ignore this rule on tslint.json by adding this on the rules object property

 "no-trailing-whitespace": false

More about the rules: https://palantir.github.io/tslint/rules/