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.
The error is coming from your code linter.
A code linter looks for code formatting inconsistencies and throws exceptions when you violate some rules (that you can specify manually).
This means it's a formatting error on your code. Your linter is basically telling you to add an empty line at the end of the file events/event-list.component.ts
. Moreover, there is a trailing whitespace somewhere in that file. There are text editor tools that can do this built-in or with a plugin, and I suggest looking for that feature on your editor. If not, you can look for online tools that strip trailing whitespace on your code.
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 therules
object property"eofline": false
-
trailing whitespace
You can ignore this rule on
tslint.json
by adding this on therules
object property"no-trailing-whitespace": false
More about the rules: https://palantir.github.io/tslint/rules/
The error is coming from your code linter.
A code linter looks for code formatting inconsistencies and throws exceptions when you violate some rules (that you can specify manually).
This means it's a formatting error on your code. Your linter is basically telling you to add an empty line at the end of the file events/event-list.component.ts
. Moreover, there is a trailing whitespace somewhere in that file. There are text editor tools that can do this built-in or with a plugin, and I suggest looking for that feature on your editor. If not, you can look for online tools that strip trailing whitespace on your code.
At the end of the export class, at "}", simply press enter. That should take the cursor to a new line. This takes away the error.
You can just give it what it is asking for by pressing enter in case of a newline or removing trailing space by going to that location and hitting backspace.
© 2022 - 2024 — McMap. All rights reserved.