mpeterv / luacheck

A tool for linting and static analysis of Lua code.
MIT License
1.91k stars 318 forks source link

luacheck show warning when use "module" function in lua5.1 #213

Closed stzb321 closed 3 years ago

stzb321 commented 3 years ago

Here is example of code: a.lua

module("aModule" ,package.seeall)
AMethod = function()
    print("AMethod")
end

b.lua

aModule.AMethod()

.luacheckrc

std = "lua51"
codes = true
allow_defined_top = true

luacheck show accessing undefined variable warning when checking b.lua image

In a.lua, aModule already be defined as a global variable. Is the module function not supported in luacheck?

stzb321 commented 3 years ago

close this issue after read #198