Skip to content

How to check "no-unknown" equivalent from lua-language-server - assert every variable/function is typed #964

Closed

Description

@dquixote-jr

Problem

The following file (test.lua) returns no errors when doing a check with emmylua_check -c ./.emmyrc.json --warnings-as-errors test.lua:

local function do_add(x, y)
  return x + y
end

return do_add

My .emmyrc.json is as follows:

{
  "format": {
    "externalTool": {
      "program": "stylua",
      "args": ["-", "--stdin-filepath", "${file}"]
    }
  },
  "runtime": {
    "version": "LuaJIT"
  },
  "diagnostics": {
    "globals": ["ngx"],
    "disable": ["unnecessary-if", "invert-if"]
  }
}

Expected behaviour

That emmylua_check should return an error when there is a function which is not typed.

Notes

I'm trying to make sure everything is typed properly in my code base but I'm not seeing any way to do that for functions. Is there any way or workaround to do this right now?

Activity

  1. CppCXY commented on Feb 25, 2026

    @CppCXY
    Member

    maybe only this one: incomplete-signature-doc

      "diagnostics": {
        "enables": [
          "incomplete-signature-doc"
        ]
      },
  2. dquixote-jr commented on Mar 4, 2026

    @dquixote-jr
    ContributorAuthor

    The diagnostic you mentioned, "incomplete-signature-doc", was not working properly for local functions. I've made a PR to fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions