News for hackers. Stuff that matters.
Re:TypeScript support in Electron by z3t4 on Friday June 02, 2017 @02:13PM (#14472127)
does typescript know if a parameter is undefined (misspelled) or does it only find errors like 1+'1' ?
Re:TypeScript support in Electron by 0xcoffee on Friday June 02, 2017 @02:46PM (#14472369)
It is a full static checking system, so it will find obvious errors like mistyping something, but it also infers alot of information from the context.

I made a small simple demo here: https://www.typescriptlang.org/play/index.html#src=const%20e...

Note: Click Options and enable all the settings. Typescript works best in strict mode, but it seems options arn't including in sharing via url.

Re:TypeScript support in Electron by z3t4 on Tuesday June 06, 2017 @04:34AM (#14495665)
It seems it can only find properties if they are defined as foo = {bar: 1}; and not foo={};foo.bar=1;
Re:TypeScript support in Electron by rcchen on Friday June 02, 2017 @02:38PM (#14472324)
it'll throw an error if a parameter is undefined, and https://github.com/Microsoft/TypeScript/issues/15333 which lands in the next version auto-suggests spelling corrections as well
Re:TypeScript support in Electron by koolba on Friday June 02, 2017 @02:53PM (#14472433)
Of course. That's table stakes for any static type checking.

In fact to set a global value (ex: window.Foo) requires a bit of extra work to instruct the type check that your new property is not errant.

Re:TypeScript support in Electron by fdsfsafasfdas on Friday June 02, 2017 @05:15PM (#14473361)
What is the error in 1+'1'? It seems like it would just be '11'.

Unless, of course, you're implying it converts javascript into a strongly typed language, which would be amazing.

Re:TypeScript support in Electron by boubiyeah on Friday June 02, 2017 @05:24PM (#14473430)
It keeps most of JS semantics, for better or worse :p

1 + '1' is authorized.

1 + [] is not.