luajit and luau supporting 5.1 only is a feature: it freeze language so no more backward compatibility breaks
Lua has many quirks (global by default etc.) but with a language server like https://luals.github.io/, you can detect most of them easily plus optional type annotations.
Also, it’s possible to force global variables to be explicitly declared.
And now More discussion: https://lua.org/pil/14.2.html