Since this is intentional, a feature request would need to be made instead. It’s a good idea to group state into tables or separate code into multiple modules.
Yes, the idea is that global variables shouldn’t be used. There’s no way to disambiguate between a typo on a local variable reassignment and a new global variable assignment, which is a reason the analyzer will report false positives like this.
I did read it. It’s intentional that using a global variable does this, you’d need to make a feature request or just use tables to group state. The 200 variable limit is rarely reached, so not factored into design decisions.
Not only is this not a bug, but it cannot work the way that you want. Consider the following:
local myThing = 6
myThng = 7
If things worked the way you want, then this would not register as an error, despite being exactly the kind of error that Luau was created to avoid. Basically this not counting as an error would mostly defeat the point of Luau’s type checking.
The solution to your issue is to structure your code in a way where you don’t have 200 local variables. If you use good code structure you should not be running into that limit. If you’re really struggling I could suggest ways to change the code structure.
If Studio allows a global variable, but doesn’t allow it with -!strict, then this is indeed a bug.
Either Studio doesn’t allow global variables in any situation, or it allows it in all situations.
This would be an impractical stance to take. Existing Lua code out there contains a lot of global variables. If we took the above stance then that code would not be able to advantage of typechecking without completely migrating away from using those globals, where nonstrict mode is supposed to generally work with existing code.