darklua
DocumentationTry itGitHub

remove_nil_declaration


Added in 0.8.0

This rule removes trailing nil values in local assignments. Additionally, it will trim unnecessary expressions in assignments when they do not cause any side-effects.

Examples


local var = nil
local a, b, c = 1, nil, nil
local a, b = nil, call()
local var = call(), otherValue, true
InputOutput
local var = nil
local var 
local a, b, c = 1, nil, nil
local a, b,c = 1
local a, b = nil, call()
local b ,a=(call())
local var = call(), otherValue, true
local var = call()