This is the convention that we agreed to use on this project.
This is not yet fixed, it may change if we see fit until the first release.
GLOBAL_VAR = "" -- UpperCase
function GlobalFunc() end -- PascalCaselocal someVariable = "" -- camelCase
local function someFunction() end -- camelCaselocal MyObject = {} -- PascalCase
function MyObject.StaticMethod() end -- PascalCase
function MyObject:instanceMethod() end -- camelCaselocal function func(requiredParam) end -- camelCase
local function func(_optionalParam) end -- camelCase prefixed with underscoreSeparate parameters with a space after the comma.
-- Wrong
function(param1,param2)
-- Good
function(param1, param2)---@class MyClass Description of the class
local MyClass = {}
--- Short description of the usage of this method
---@param param1 string Description of this parameter
---@return string
function MyClass:setName(param1)
return param1
endView Emmylua docs for more information about annotations.