Intellij appends semicolon to TypeScript enums
It seems that TypeScript thinks there should be a semicolon after the last item in an enum, like this:
const enum EsNumeros {
kUno = 1,
kDos,
kTres;
}
The typescript compiler doesn't like that terminating semicolon. So I remove it to get rid of the compilation error. Next time I commit to VCS, IntelliJ dutifully puts them right back. Presumably by the "Before Commit: Cleanup" action.
Is there some configuration that controls this behavior that I could flip?
Mike
Please sign in to leave a comment.
What IDEA version do you use? Idea 15.0.1 doesn't show 'Unterminated statement' warning for field without semocolon, moreover, it shows error is this semicolon is there... Anyway, you can disable this inspection in Settings/Editor/Inspections/javaScript/Code style Issues, Unterminated statement
I'm using 15.0.1. And it definitely shows a "Unterminated Statement" warning for an enum without a semicolon after the last enum value. I've checked for updates, but get none, so I assue I'm up to date with the relevant plugins.
Mike
to me, 'unterminated statement' is only reported if there is an inline comment after last field (https://youtrack.jetbrains.com/issue/WEB-14170):



in other cases it works fine:
Yes, that's exactly what I have in my code. I removed those comments to "clean up" the code before pasting it into the forum posting. I had no ide that "fixed" the problem. I notice it gives the same error if I use a refular /* */ comment after the last enum, so it's not just line comments. I see now yu already have a bug report for this, so I "voted" for that one, and assume it will be fixed in due course.
Thanks!
Mike