Removed all ---@diagnostic disable, even ---@diagnostic disable-next-line: redundant-parameter before tes3ui.leaveMenuMode(self.menuID), since that function doesn't accept any arguments (which the docs state correctly, see here).
Added an alias JOP.tes3itemChildren for all the types that are actually tes3items, namely: tes3alchemy|tes3apparatus|tes3armor|tes3book|tes3clothing|tes3ingredient|tes3light|tes3lockpick|tes3misc|tes3probe|tes3repairTool|tes3weapon. This allowed me to use that union type in various places where function/method uses tes3item. I needed to use --[[@as type_name]] casting to hint the correct types to the Lua extension.
This didn't fix all of the warnings, since I decided I'd only change the annotations in this PR. There are another 2 valid warnings in the Painting.lua where NodeManager.getIndex() is called. I didn't dig deep enough to know how to properly fix/hide that one.
Summary:
---@type any
---@diagnostic disable
, even---@diagnostic disable-next-line: redundant-parameter
before tes3ui.leaveMenuMode(self.menuID), since that function doesn't accept any arguments (which the docs state correctly, see here).JOP.tes3itemChildren
for all the types that are actually tes3items, namely:tes3alchemy|tes3apparatus|tes3armor|tes3book|tes3clothing|tes3ingredient|tes3light|tes3lockpick|tes3misc|tes3probe|tes3repairTool|tes3weapon
. This allowed me to use that union type in various places where function/method uses tes3item. I needed to use--[[@as type_name]]
casting to hint the correct types to the Lua extension.This didn't fix all of the warnings, since I decided I'd only change the annotations in this PR. There are another 2 valid warnings in the Painting.lua where
NodeManager.getIndex()
is called. I didn't dig deep enough to know how to properly fix/hide that one.