Skip to content

Commit

Permalink
fix: Exempt special builtin _ENV from 214 warning
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Apr 23, 2022
1 parent 932ebd9 commit 2e49315
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/luacheck/stages/detect_unused_locals.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ local function detect_unused_local(chstate, var)
elseif #var.values == 1 then
local value = var.values[1]

if var.hint_unused then
if var.hint_unused and var.name ~= "_ENV" then
if value.used then
chstate:warn_var("214", var)
end
Expand Down

0 comments on commit 2e49315

Please sign in to comment.