-- Luacheck config for CC:Tweaked (ComputerCraft) Lua runtime.
-- Runtime is Lua 5.1 inside the CC:Tweaked runtime, not standard Lua, so we
-- extend lua51 with the globals and os/table extensions CC provides.

stds.cc = {
  read_globals = {
    -- ComputerCraft APIs injected as globals by the runtime.
    "fs",
    "peripheral",
    "parallel",
    "shell",
    "term",
    "textutils",
    "colors",
    "colours",
    "rednet",
    "gps",
    "http",
    "settings",
    "window",
    "paintutils",
    "keys",
    "vector",
    "commands",
    "disk",
    "turtle",
    "periphemu", -- CraftOS-PC emulator only
    "read",
    "sleep",
    "write",
    -- CC extends the standard os/table tables with extra fields.
    os = {
      fields = {
        "getComputerID", "getComputerLabel", "setComputerLabel",
        "queueEvent", "pullEvent", "pullEventRaw",
        "startTimer", "cancelTimer", "sleep",
        "reboot", "shutdown", "version",
        "epoch", "day", "clock", "time",
        "loadAPI", "unloadAPI", "run",
      },
    },
    table = {
      fields = { "pack", "unpack" },
    },
  },
}

std = "lua51+cc"

-- _G.isRouterEnabled is a cross-module flag set/read at runtime; `_` is the
-- throwaway global used in router.lua.
globals = {
  "isRouterEnabled",
  "_",
}

-- `_VERSION` is a per-module convention (see CLAUDE.md) and intentionally unused.
ignore = {
  "211/_VERSION", -- unused local _VERSION
}

max_line_length = false

-- .stage/ holds generated flat copies of per-package sources for the CraftOS-PC
-- harness; lint the originals under packages/, not the copies.
exclude_files = { ".stage" }
