interface obj {
bar: string
}
function randomFunction() {
let foo: obj = { bar: "" }
foo.bar = "hip"
}
let snack: obj = { bar: "" }
snack.bar = "hop"
I get this warning from tslint:
Identifier 'foo' is never reassigned; use 'const' instead of 'let'. (prefer-const)
Funny though I don't get this warning in the second case with the variable snack
.
I can get rid of this warning (which clutters my console when transcompiling) with
/* tslint:disable: prefer-const */
I haven't found any bug report on the tslint project. Since I'm new to typescript I'm wondering: Do I something wrong here?
snack
. – David Sherret