Ionic 2 TypeScript in Visual Studio Code


#1

Hi,

Since Angular 2 is in Beta now, I want to try Ionic 2 in TypeScript.

But there is something not good when opening *.ts files in VSC.

How to make these errors disappear?

Thanks.:wink:


#2

This is what worked for me. I hope it helps!

Make sure to have a jsconfig.json-file which sets the target to ES6


#3

Targeting ES6 as @gigocabrera suggested should fix most of the issues, but unless something changed recently Visual Studio does not support typescript annotations, so you’ll still see errors for annotations and decorators in your app. I’ve recently switched to Webstorm, which natively handles the type annotations just fine.


#4

@gigocabrera
@swarner

Thank you all.
I’ll try other editors like Atom and Sublime since Webstorm costs a lot…


#5

I have different scenario. The ts files are fine after I created the project.

But when I add new ts file. There are some error messages in editor.

But it seems not affect my project. My project is still running without problem. So I guess it’s only the editor’s issue. My VS Code is 0.10.6.


#6

I get the same thing… anyone figured this out yet?


#7

What is the error message?


#8

Remove the “files” property in your tsconfig.json .
Here removing it did the trick.


#9

Cool thanks! worked like a charm