Closed triwav closed 3 years ago
We should also be able to warn if you use a local variable that is never defined as well.
On second thought, we should probably just build that in the parser itself since that's no longer a lint thing but an actual crash potentionally
I think it's a fair lint rule. It indicates a potential mistake but isn't a straight validation/crash reason - it can just be debug/dead code.
Brian is saying that this shouldn't be a lint rule, it should be a compiler rule (built into bsc). Very similar to typescript's --noUnusedLocals
and --noUnusedParameters
You can't track that without doing the whole variables and codepaths tracking. This means moving most of what I have in this repo into the compiler.
We should have all the information needed to know if a local variable never gets used. We should have a rule that if a variable is unused it warns about it.