Defer need-check-nil and clean up stale suppressions

emmylua deserialises an unknown diagnostic code to a catch all that
matches no checker, so every `invisible`, `nil-check` and
`global-element` suppression was silently doing nothing. Renamed to the
emmylua codes. `name-style-check` has no equivalent and is dropped, it
was already disabled under luals.

The `get_tile` suppressions referenced an api typedef bug from 2024
which no longer reproduces.

need-check-nil is deferred rather than disabled on merit: a third of the
407 findings come from MapPosition and BoundingBox being aliased as
`struct|[double, double]`, so every `entity.position.x` reads as
possibly nil. The rest need per site knowledge of runtime invariants.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
bbassie
2026-08-07 15:31:18 +00:00
co-authored by Claude Opus 5
parent b9cfbc9036
commit c233a9ab06
13 changed files with 19 additions and 23 deletions
+3 -3
View File
@@ -188,9 +188,9 @@ function Gui._ensure_consistency(event)
-- This check isn't needed, but allows the toolbar file to be deleted without modifying any lib code
if Gui.toolbar then
--- @diagnostic disable-next-line invisible
--- @diagnostic disable-next-line: access-invisible
Gui.toolbar._create_elements(player)
--- @diagnostic disable-next-line invisible
--- @diagnostic disable-next-line: access-invisible
Gui.toolbar._ensure_consistency(player)
end
end
@@ -211,7 +211,7 @@ local function on_gui_opened(event)
if visible then
event.element = element
--- @diagnostic disable-next-line invisible
--- @diagnostic disable-next-line: access-invisible
define:raise_event(event)
end
end
+1 -1
View File
@@ -29,7 +29,7 @@ Toolbar.on_gui_button_toggled = script.generate_event_name()
--- @class _ExpElement._prototype
--- @field on_button_toggled ExpElement.OnEventAdder<EventData.on_gui_button_toggled>
--- @diagnostic disable-next-line: invisible, inject-field
--- @diagnostic disable-next-line: access-invisible, inject-field
function ExpElement._prototype.on_button_toggled(self, handler)
return self:on_event(Toolbar.on_gui_button_toggled, handler)
end