DocumentationTry itGitHub


Added in 0.3.2

This rule will merge consecutive local assignments.

The rule will not merge assignments if one assignment temporally depends on the previous one, since it would break the code or change the behavior. The following code would not be changed:

local foo = 1
local bar = foo

Since functions can return multiple values, assignments that extract more than one value will not get merged.

local foo, bar = multiple_return_values()
local baz = 0


local foo = 1
local bar = 2

local foo = 1
local bar = 2

local foo ,
bar = 1