Something simple that will cause this to happen.
let _tick = 0;
this.app.ticker.add( () => {
moveSprites(dots);
_tick += .2;
return;
});
Tslint options are set to the following:
"rules": {
"object-literal-sort-keys": false,
"no-unused-variable": [true, {"ignore-pattern": "^_"}]
}
From searching I thought that rule would resolve and allow it to be ignored but nope.
One solution was to write it like this. It will pass but it will then complain about the tick += .2 being assigned but never used. Plus, this changes the behavior.
this.app.ticker.add( (tick = 0) => {
moveSprites(dots);
tick += .2;
return;
});
Then finally I found // @ts-ignore and that worked... I'm new to typescript and I could see this being a problem in instances were you just need to keep up a variables state; only ever setting it. I also see some conventions to _var name as protected class fields but also for these instances as well? What is the right way? I like the benefits of TS, but being new I'm spending a lot of time appeasing the ts linter.
I'm new to typescript and I could see this being a problem in instances were you just need to keep up a variables state; only ever setting it.
If you have a variable which is never read from the variable is useless, just remove it. – Conceptionconceptualtick
variable, typescript will stop complaining. – Shortening