mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
Fix lua lint warnings reported by emmylua
The largest source was compat.lua returning the setmetatable call directly, which made emmylua infer the module type from the metatable rather than the LibCompat class, hiding every field from consumers. The remaining fixes are nil guards on gui element and character accesses, type annotations for research_sync's script data and player_auth's rcon arguments, casts where the api's read/write union types are wider than the values at runtime, and scoped diagnostic disables for the vendored json.lua and the version fallback code that touches apis removed from the current typedefs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
59cd193b65
commit
a25f8c8611
8 files changed
+43
-19
No files matched your search
@@ -1,3 +1,6 @@
|
||||
--- Undefined fields are expected, the typedefs only cover the latest version
|
||||
--- @diagnostic disable: undefined-field
|
||||
|
||||
local function send_json(channel, data)
|
||||
data = helpers and helpers.table_to_json(data) or game.table_to_json(data)
|
||||
print("\f$ipc:" .. channel .. "?j" .. data)
|
||||
|
||||
Reference in new issue
Block a user