What's the best available configuration/watcher/linters/whatever for type checking in WebStorm with ECMAScript 6 code?

I'm trying to figure out how close to TypeScript-level type checking I can get with WebStorm and ES6, specifically traceur --experimental (so it includes things like the Angular 2.0 extensions and async/await) :)  My current need is around writing ES6 to run in node, but if there's something that also works in the browser (or even just in the browser), that'd be great to know about, too.

In particular, I'm hoping to use the Angular 2.0 extension that allows TypeScript-style type specifiers for things like function parameters.  Going the JSDoc-style-comments route is probably more likely to lead to something workable with JSHint, for instance, but at the moment I'm hoping for something that supports function concatstrings(a:String, b:String) { return a + b; }

Just setting the JavaScript language version to ES6 and enabling the traceur filewatcher (adding --experimental to the command-line arguments in the configuration) is pretty good in terms of highlighting clear type violations (like trying to call concatstrings(1, 7) for instance) but that appears to be classified as a 'validation' done on the JavaScript and I'm not sure how I could see a list of all the 'validation failures' across the entire project in a single place.  I don't need something that functions via the command-line and/or breaks a 'build' like a TypeScript compiler would, but if the validations start failing in foo.js file when I change the type of a function in bar.js, I'd like to be able to see that in some kind of task window so I know that I have type problems if the 'javascript validation errors' window (what I'm looking for) shows a list of errors.

I've tried JSHint with esnext: true, moz: true and Closure Linter, but neither seems to support the Angular 2.0 extensions (at least, AFAICT) nor async/await, and I'm not sure what kind of type-checking analysis they do (I'm fine with only getting the type-checking 'failures' in the IDE if the 'right' type checking logic for ES6 code isn't in an available tool.

Is there any way to get this kind of type-checking (whether on the original or post-traceur code) while using the Angular 2.0 extensions, or do I need to just give up on that path and start adding the JSDoc-style comments for JSHint / Closure Compiler / Closure Linter / etc to understand and check the types?


Please sign in to leave a comment.