I've been using luacheck to check my code and really like the detection of non-whitelisted globals (among other things) since it makes typos nearly impossible.
Unfortunately, luacheck doesn't know about the (many) globals that are part of the FG rulesets and API.
I've also made a GitHub Action which allows you to generate a luacheckrc file from the rulesets and extensions that you work with.
The README is pretty clearly written, but you can find my personal example here along with its output here.
For insight into how I personally use this:
I use VSCodium for development along with the LuaCoderAssist extension. Setting it up is a bit goofy ("config file path" means path to directory, not path to file -- this of course means the file must have the expected name of ".luacheckrc" -- and you also need to disable "define the luacheck cli options automatically"), but it has a bunch of very neat features to help with lua development and encourage use of slim functions. By using my luacheckrc config file in this way, it automatically underlines MANY common mistakes in real-time as you're editing scripts. For people who want to use global functions without being warned or having to create specific exemptions, add "allow_defined_top = true" to the top of the .luacheckrc file. (suggested by MeAndUnique)