I know that JavaScript (and thus TypeScript) support the omission of semicolons in many cases. Nevertheless I want to add semicolons to be unambiguous as suggested in TypeScript Deep Dive
However I cannot find a guide that lists where to use semicolon. For example look at the following code
class Person {
private name: string; // A
constructor(name: string) {
this.name = name;
}; // B
public add = () => {
return "C";
}; // C
}; // D
I'm fairly sure to use a semicolon at A. But what about B, C, D and all the other cases not covered by my example?
I'm not asking where to omit semicolon but where to add them. An answer like always does not fulfill my needs since I cannot add a ;
after public
. I want to know where exactly to put semicolon.