diff --git a/.github/workflows/fmtk.yml b/.github/workflows/fmtk.yml index 13fa984f..80ee4575 100644 --- a/.github/workflows/fmtk.yml +++ b/.github/workflows/fmtk.yml @@ -20,12 +20,12 @@ jobs: jq -s '.[0] * .[1].settings' temp.luarc.json ${{ github.workspace }}/factorio/config.json > check.luarc.json - name: Install LuaLS run: | - wget https://github.com/LuaLS/lua-language-server/releases/download/3.13.2/lua-language-server-3.13.2-linux-x64.tar.gz -q -O lusls.tar.gz + wget https://github.com/LuaLS/lua-language-server/releases/download/3.13.9/lua-language-server-3.13.9-linux-x64.tar.gz -q -O lusls.tar.gz mkdir luals && tar -xf lusls.tar.gz -C luals && rm lusls.tar.gz - name: Run Lint Report shell: bash run: | - ./luals/bin/lua-language-server --check=. --logpath=. --configpath=check.luarc.json --checklevel=Information + ./luals/bin/lua-language-server --check=. --logpath=. --configpath=check.luarc.json --checklevel=Information --check_out_path=check.json # Credit to https://github.com/Krealle/luals-check-action/blob/main/action.yml # Although some minor fixes were needed diff --git a/exp_gui/module/data.lua b/exp_gui/module/data.lua index c792fcdb..bae2488b 100644 --- a/exp_gui/module/data.lua +++ b/exp_gui/module/data.lua @@ -87,7 +87,7 @@ function GuiData._metatable.__index(self, key) -- Check a given child table based on the object type assert(type(key) == "userdata", "Index type '" .. ExpUtil.get_class_name(key) .. "' given to GuiData. Must be of type userdata.") - local object_name = key.object_name + local object_name = key.object_name --- @diagnostic disable-line assign-type-mismatch if object_name == "LuaGuiElement" then local data = self._raw.element_data local player_elements = data and data[key.player_index] @@ -110,7 +110,7 @@ end --- @param value unknown function GuiData._metatable.__newindex(self, key, value) assert(type(key) == "userdata", "Index type '" .. ExpUtil.get_class_name(key) .. "' given to GuiData. Must be of type userdata.") - local object_name = key.object_name + local object_name = key.object_name --- @diagnostic disable-line assign-type-mismatch if object_name == "LuaGuiElement" then local data = self.element_data local player_elements = data[key.player_index] diff --git a/exp_gui/module/iter.lua b/exp_gui/module/iter.lua index 450a7a52..388bf8ef 100644 --- a/exp_gui/module/iter.lua +++ b/exp_gui/module/iter.lua @@ -37,6 +37,7 @@ local function nop() return nil, nil end local function next_valid_element(elements, prev_index) local element_index, element = next(elements, prev_index) while element and not element.valid do + --- @cast element_index -nil elements[element_index] = nil element_index, element = next(elements, element_index) end @@ -61,6 +62,7 @@ local function next_valid_player(scope_elements, players, prev_index, online) if index == nil then return nil, nil, nil end + --- @cast player -nil if online == nil or player.connected == online then local player_elements = scope_elements[player.index] diff --git a/exp_legacy/module/config/expcore/roles.lua b/exp_legacy/module/config/expcore/roles.lua index 2aaa3528..a9841870 100644 --- a/exp_legacy/module/config/expcore/roles.lua +++ b/exp_legacy/module/config/expcore/roles.lua @@ -280,7 +280,7 @@ local default = Roles.new_role("Guest", "") "command/data-preference", "command/connect", "gui/player-list", - "gui/rocket-info", + --"gui/rocket-info", "gui/science-info", "gui/task-list", "gui/warp-list", diff --git a/exp_legacy/module/expcore/permission_groups.lua b/exp_legacy/module/expcore/permission_groups.lua index 9181e614..6df8f468 100644 --- a/exp_legacy/module/expcore/permission_groups.lua +++ b/exp_legacy/module/expcore/permission_groups.lua @@ -142,7 +142,7 @@ group:set_action('toggle_map_editor', false) ]] function PermissionsGroups._prototype:set_action(action, state) - local input_action = defines.input_action[action] + local input_action = defines.input_action[action] --[[ @as defines.input_action? ]] if input_action == nil then input_action = action end assert(type(input_action) == "number", tostring(action) .. " is not a valid input action") self.actions[input_action] = state diff --git a/exp_legacy/package.json b/exp_legacy/package.json index c9bff84b..089d643c 100644 --- a/exp_legacy/package.json +++ b/exp_legacy/package.json @@ -16,9 +16,9 @@ "@clusterio/lib": "^2.0.0-alpha.19" }, "devDependencies": { - "typescript": "^5.5.3", + "@clusterio/lib": "2.0.0-alpha.20", "@types/node": "^20.4.5", - "@clusterio/lib": "^2.0.0-alpha.20" + "typescript": "^5.5.3" }, "dependencies": { "@expcluster/lib_commands": "workspace:*", diff --git a/exp_scenario/module/commands/connect.lua b/exp_scenario/module/commands/connect.lua index 5cb4b4f0..b935b45d 100644 --- a/exp_scenario/module/commands/connect.lua +++ b/exp_scenario/module/commands/connect.lua @@ -34,7 +34,7 @@ local function get_server_id(server) if server_count > 1 then return false, { "exp-commands_connect.too-many-matching", concat(server_names, ", ") } elseif server_count == 1 then - local server_id, server_details = next(servers) + local server_id, server_details = next(servers) --- @cast server_details -nil local status = External.get_server_status(server_id) if server_id == current_server.id then return false, { "exp-commands_connect.same-server", server_details.name } diff --git a/exp_scenario/package.json b/exp_scenario/package.json index ee65d14c..963df025 100644 --- a/exp_scenario/package.json +++ b/exp_scenario/package.json @@ -16,17 +16,17 @@ "@clusterio/lib": "^2.0.0-alpha.19" }, "devDependencies": { - "typescript": "^5.5.3", + "@clusterio/lib": "2.0.0-alpha.20", + "@clusterio/web_ui": "2.0.0-alpha.20.b", "@types/node": "^20.4.5", "@types/react": "^18.2.21", "antd": "^5.13.0", "react": "^18.2.0", "react-dom": "^18.2.0", + "typescript": "^5.5.3", "webpack": "^5.98.0", "webpack-cli": "^5.1.4", - "webpack-merge": "^5.9.0", - "@clusterio/web_ui": "^2.0.0-alpha.20.b", - "@clusterio/lib": "^2.0.0-alpha.20" + "webpack-merge": "^5.9.0" }, "dependencies": { "@expcluster/lib_commands": "workspace:*", diff --git a/exp_util/module/module_exports.lua b/exp_util/module/module_exports.lua index e1deb308..e6394bae 100644 --- a/exp_util/module/module_exports.lua +++ b/exp_util/module/module_exports.lua @@ -42,7 +42,7 @@ local function check_type(value, type_name) if type_name == "userdata" then return false, value_type end - value_type = value.object_name + value_type = value.object_name --- @diagnostic disable-line assign-type-mismatch elseif value_type == "table" then if type_name == "table" then return false, value_type diff --git a/exp_util/package.json b/exp_util/package.json index cb576faf..ea90794e 100644 --- a/exp_util/package.json +++ b/exp_util/package.json @@ -16,7 +16,7 @@ "@clusterio/lib": "^2.0.0-alpha.19" }, "devDependencies": { - "@clusterio/lib": "^2.0.0-alpha.20", + "@clusterio/lib": "2.0.0-alpha.20", "@types/node": "^20.14.9", "typescript": "^5.5.3" },