When working with Typescript, I've noticed that my code is sometimes accepted by the compiler even when I mistakenly write name
instead of someObject.name
.
To test this behavior, I compiled a file with just console.log(name)
and surprisingly, the Typescript compiler accepted it. Could there be some global symbols defined in Typescript?
My current setup includes Typescript 2.8.1 and only NPM itself along with Typescript as global packages.