Variable of name, "name", is not validated
When a variable is named "name" (let name;) it is not checked for validity.
For example:
let s = {};
console.log(s[t]);
The tsc command fails on this code since t obviously doesn't exist. However, changing nothing else but the variable used in the object's index...
let s = {};
console.log(s[name]);
... tsc doesn't complain at all about this. To me this seems like a bug. Why are variables named name special?
Apologies if I missed an already open issue but due to the nature of the terms used to describe this issue it's kinda hard to search on.
name is the global that you could also access via window.name (https://developer.mozilla.org/en-US/docs/Web/API/Window/name)
See also https://github.com/Microsoft/TypeScript/issues/1351#issuecomment-106573083 for a good explanation of why it would be a bad idea to remove the global name declaration, as one might be tempted to do.
I had a sneaking suspicion that it was falling back to a higher scope. Silly javascript. I tried the last suggestion in the thread you mentioned but it seemed to work fine. I'll comment there. Thank you once again @RyanCavanaugh!