Closed
Description
Personally, I like the look (and simplicity) of ECMA6 / TypeScript without semi-colons. The only problem is that there are some known danger-zones with automatic semi-colon insertion. Could we have compiler warnings to prevent these from slipping through the cracks?
Example:
function dangerous(): string {
return
"watch the semi-colons!"
}
dangerous()
Compiles to the following with no warnings or compiler errors (even though the function actually doesn't return a string):
function dangerous() {
return;
"watch the semi-colons!";
}
dangerous();
This specific case is kind of scary / annoying, but it might be worth looking into others.
Thoughts?