interface obj {
bar: string
}
function randomFunction() {
let foo: obj = { bar: "" }
foo.bar = "hip"
}
let snack: obj = { bar: "" }
snack.bar = "hop"
Upon transcompiling, a warning from tslint pops up:
Identifier 'foo' is never reassigned; use 'const' instead of 'let'. (prefer-const)
Interestingly, the same warning does not occur with the variable snack
.
To suppress this warning in the console output, I can use
/* tslint:disable: prefer-const */
I have not come across any reported bugs on the tslint project. As a newcomer to typescript, I'm left wondering if I am making a mistake here.