Skip to content

All Diagnostics

Complete reference of every diagnostic code. For an introduction to how diagnostics work and how to configure them, see the Diagnostics guide.

Warning severity

CodeDescription
deprecatedUsage of @deprecated symbols
discard-returnsIgnoring @nodiscard return values
type-mismatchArgument type vs @param mismatch
return-mismatchReturn type vs @return mismatch
field-type-mismatchField assignment vs @field type mismatch
assign-type-mismatchReassignment vs @type mismatch
generic-constraint-mismatchGeneric argument doesn't satisfy class constraint
missing-parameterMissing required function arguments
redundant-parameterExtra function arguments
missing-return-valueReturn with fewer values than @return
redundant-return-valueReturn with more values than @return
grouped-return-mismatchReturn values don't match any tuple-union @return case
missing-returnFunction missing return statement
undefined-globalReference to unresolved global name
undefined-fieldAccessing nonexistent field on @class
need-check-nilField/method access on possibly-nil value (off by default)
access-privateAccessing @field private from outside
access-protectedAccessing @field protected from outside hierarchy (also _-prefixed fields when implicit_protected_prefix is enabled)
duplicate-indexDuplicate keys in table constructors
redundant-valueExtra values in assignments
unbalanced-assignmentsMore variables than values in assignments
missing-fieldsMissing required fields when constructing @class tables
undefined-doc-classUndefined class name in @class Foo: Parent
undefined-doc-nameUndefined type name in annotations
undefined-doc-param@param name not matching function parameters
duplicate-doc-paramDuplicate @param annotations
duplicate-doc-fieldDuplicate @field annotations
duplicate-doc-aliasDuplicate @alias declarations
doc-field-no-class@field on a non-@class table
doc-func-no-functionFunction-level annotation (@param, @return, etc.) not attached to a function definition
circle-doc-classCircular @class inheritance chains
malformed-annotationUnknown or incomplete ---@ annotations
multi-return-projectionreturns<F> discards extra return values from F
builds-field-not-self@builds-field method uses @return ClassName instead of @return self
unknown-diag-codeUnknown code in @diagnostic directives
duplicate-constructorMultiple @constructor on a single class
constructor-return@constructor with return other than @return self
count-down-loopFor-loop step direction doesn't match start/end
wrong-flavor-apiAPI not available in all declared flavors
redundant-class-genericMethod redeclares class-level @generic

Hint severity

CodeDescription
return-self-class-nameMethod uses @return ClassName instead of @return self
unused-localUnreferenced local variables
unused-functionUnused function definitions
unused-varargFunction declares ... but never uses it (off by default)
redefined-localSame-scope local variable redefinition
create-globalImplicit global creation
inject-fieldSetting undeclared fields on @class tables
duplicate-set-fieldSetting an already-set field on @class tables
unreachable-codeCode after return
code-after-breakCode after break
incomplete-signature-docPartial @param/@return annotations (off by default)
empty-blockEmpty control flow body
redundant-returnBare return at end of function
trailing-spaceLine ends with whitespace
not-precedencenot x <cmp> y is (not x) <cmp> y
implicit-nil-returnBare return in function with optional @return (off by default)
unknown-param-typeParameter type can't be inferred (off by default)
unknown-return-typeReturn value has no resolvable type (off by default)
unknown-local-typeLocal assignment has unknown type (off by default)
unknown-field-typeField assignment has unknown type (off by default)

LuaLS compatibility aliases

AliasMaps to
invisibleaccess-private, access-protected
param-type-mismatchtype-mismatch
return-type-mismatchreturn-mismatch