The Luacheck linter produces a warning when an if statement branch doesn't include any statements. For example, if I have a file called test.lua with the following code
local function f(x)
if x == "hello" then
-- nothing to do
elseif…
I want luacheck treat "accessing undefined variable 'variable' " warning as error, which ALWAYS make sense for me.
so how can I config specific warning , let's say W113 as errors, so I can find them at a glance
This is more of a design philosophy question as I already know you shouldn't call a function with : (object-oriented syntactic sugar) if the function has been defined without the self keyword by using .. But the problem is that programmers using a…
When writing Lua code, I felt that the built-in methods for string were a bit lacking. So I added this function to the string class.
---@param self string
function string:firstToUpper() -- setting undefined field 'firstToUpper' of global…
I have a module constants.lua that has a lot of globals defined. How can I ignore all of these in luacheck?
I assume I can build logic to do this inside my .luacheckrc: load constants.lua, see what it added to _G, and then add those to…
I have a project like this (in fact, there are more files and dirs):
.
├── src
│ ├── main.lua
│ └── smth.lua
└── tests
├── others
│ ├── others_1.lua
│ ├── others_2.lua
│ └── others_3.lua
├── speed_tests
│ ├──…