- Use `luacheck` with a `.luacheckrc` config to detect undefined globals, unused variables, and shadowed locals.
- Use `stylua` to auto-format Lua files — configure indentation and line width in `stylua.toml` and commit it to the repo.
- Run `luacheck .` and `stylua --check .` in CI to block merges with lint or formatting violations.
- Configure `.luacheckrc` with `globals = { 'vim', 'love', 'ngx' }` to declare environment-specific globals and suppress false positives.
- Set `stylua.toml` with `indent_type = "Spaces"`, `indent_width = 4`, and `column_width = 100` for consistent formatting.
- Use `luacheck --codes` to display rule codes in output and add `-- luacheck: ignore 211` inline for intentional unused variables.
- Integrate `luacheck` with Neovim via `nvim-lint` or with VS Code via the `luacheck` diagnostic provider.