> a large lua game code base, over 4000 files, 1.5 million lines of code
Interesting; how do you manage to keep consistency? Do you have special tools to e.g. detect inadvertent global variables? I once wrote a Smalltalk VM in Lua (https://github.com/rochus-keller/Smalltalk/blob/master/Inter...) which is a much smaller code base, but even with this modest size I quickly would have lost track of e.g. scopes and names without tools I had to write myself (https://github.com/rochus-keller/LJTools).
Most of the time nothing is used. The thing is that iterating is so quick, that you find the problems really fast.
Although, I've been using luacheck https://github.com/mpeterv/luacheck. It is quite nice, but you have to write down the global variables by hand on the config file.
Edit: Also, the vscode lua plugins have been getting quite good, and completion works to a certain extent.
The first line tells luacheck that the variables `init` and `handler` are globals, and the second line tells it to ignore lines that contain just whitespace (a quirk the text editor I use uses to manage indenting levels).
Lua’s language server can be nice for detecting unwanted globals. It gives you a warning whenever you declare a global that starts in lowercase, which works nicely if you’re okay with using uppercase globals as a convention
Although, I've been using luacheck https://github.com/mpeterv/luacheck. It is quite nice, but you have to write down the global variables by hand on the config file.
Edit: Also, the vscode lua plugins have been getting quite good, and completion works to a certain extent.