Global variable in a single ts file

I disagree strongly. See this topic for why. I do not find “is everywhre on the web” compelling in the slightest. The point of support forums like this is to guide people towards good coding practices, not popular ones.

Absolutely agree. I am trying to argue the merits of my opinions on this matter, and I am perfectly willing to let it stand in the court of public opinion.

I hope anybody in the future coming across this thread does not follow in your footsteps.

I guess I appreciate the fact that your primary concern is making something “work”. Mine is that future readers will spend less time going through the frustrations I went through, and will become more prolific programmers faster. I feel this thread is a net negative on that front.