Skip to content

Commit a7102fa

Browse files
committed
only mark return without any values
1 parent 751e5b6 commit a7102fa

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

script/core/diagnostics/redundant-return.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,8 @@ return function (uri, callback)
1414
if not source.parent or source.parent.type ~= "function" then
1515
return
1616
end
17-
for _, node in ipairs(source) do
18-
while node and node.type == "paren" do
19-
node = node.exp
20-
end
21-
if node and (node.type ~= "nil" or #node > 0) then
22-
return
23-
end
17+
if #source > 0 then
18+
return
2419
end
2520
callback {
2621
start = source.start,

0 commit comments

Comments
 (0)