more type hints and resolved diagnostic disables with 'as'

This commit is contained in:
Mikayla Fischler
2024-09-21 17:58:53 -04:00
parent ec2921e393
commit 2047794173
3 changed files with 9 additions and 7 deletions

View File

@@ -295,8 +295,12 @@ local function config_view(display)
for i = 1, tmp_cfg.UnitCount do
local conf = tool_ctl.cooling_elems[i]
-- already verified fields are numbers
---@diagnostic disable-next-line: assign-type-mismatch
tmp_cfg.CoolingConfig[i] = { TurbineCount = tonumber(conf.turbines.get_value()), BoilerCount = tonumber(conf.boilers.get_value()), TankConnection = conf.tank.get_value() }
tmp_cfg.CoolingConfig[i] = {
TurbineCount = tonumber(conf.turbines.get_value()) --[[@as number]],
BoilerCount = tonumber(conf.boilers.get_value()) --[[@as number]],
TankConnection = conf.tank.get_value()
}
if conf.tank.get_value() then any_has_tank = true end
end