What is the best practice for Meteor, Webstorm and Typecript to work together?

I use Webstorm to manage the Meteor project, and I like the strong validation provided by Typescript.

There are two options for converting Typescript to js, ​​one of which is an observer for Webstorm files, the other for adding meteortypescript: compiler.

The first one seems more strict because it will complain if I don’t add the correct link, but it cannot deal with existing files, do I need to add the generated js files to VCS? Otherwise, other team members must manually generate files after updating from VCS.

Generation with meteortypescript: compiler, on the other hand, makes tests in tests / jasmines ignored in speed, which are written in Typescript and do not generate js files in the same way.

And what definition files should I use?

meteor add typescript-libs

doesn't add any .d.ts to my project, how to direct them?

mrt add typescript-libs

adds typescript -libs to the packages folder, but seems to be deprecated.

tsd query meteor --action install

installs a later version of meteor.d.ts, but cannot find hardware: router and some other definition files.

+4
source share
1 answer

Add the following packages to your project.

meteor add meteortypescript:typescript-libs
meteor add meteortypescript:compiler

Add to your .gitignore→.ts

.ts( JS) :

/// <reference path=".meteor/local/build/programs/server/assets/packages/meteortypescript_typescript-libs/definitions/all-definitions.d.ts" />

!

+1

All Articles