function Foo() {
let a = 3;
a++;
return a;
};
with tslint.json configuration:
{
"extends": "tslint:recommended",
"rules": {
"semicolon": [true, "always"]
},
"jsRules": { },
"rulesDirectory": [ ]
}
According to the docs, no error should be thrown. "always" enforces semicolons at the end of every statement, and says nothing about any behaviour on unnecessary semicolons.
"Unnecessary semicolon" error.
Ideally I would like an option to enforce semicolon usage after a function declaration. Happy to submit a PR for this.
going to lump this together with #2015; see my comment https://github.com/palantir/tslint/issues/2015#issuecomment-271642753 -- we'd welcome a PR to separate the "unnecessary semicolon" checking into a new rule option
"Unnecessary semicolon" when only set to "always".
private method = () => {
// do something
};
No error when "ignore-bound-class-methods" also applied.
for those we want to enforce semicolon after class methods, use:
"semicolon": [true, "always", "strict-bound-class-methods"]
Most helpful comment
for those we want to enforce semicolon after class methods, use: