// code snippet
const {
var1,
var2,
var3,
var4,
var5,
var6,
var7,
...restProps
} = this.props;
with tslint.json configuration:
{
"extends": "tslint:recommended",
"rules": {
"interface-name": [ true, "never-prefix"]
}
}
Rule tailling-comma is violated.
Missing trailing comma
However, tsc will throw if comma is there.
TS1013: A rest parameter or binding pattern may not have a trailing comma.
tslint recognizes the spread operator in use and does not mark rule as violated.
I was looking at this and it turns out you just have to add an extra option "esSpecCompliant".
"trailing-comma": [
true,
{
"multiline": "always",
"singleline": "never",
"esSpecCompliant": true
}
]
This should probably be a part of the tslint:recommended set of rules though.
Merged
Most helpful comment
I was looking at this and it turns out you just have to add an extra option "esSpecCompliant".
This should probably be a part of the
tslint:recommendedset of rules though.