-
Notifications
You must be signed in to change notification settings - Fork 193
Closed
Labels
featurea feature request or enhancementa feature request or enhancement
Description
I think this double lint is not correct either you see the if
after an else
as a new expression, then only the second one should be marked, or you understand an if
with a lot of else
as one expression (that's how I would see it) and then only the first one would have to be marked.
lint(
trim_some("
function(x, y) {
if(x) {
1
} else if(y) {
2
}
}
"),
return_linter(return_style = "explicit", allow_implicit_else = FALSE)
)
<text>:2:9: style: [return_linter] All functions must have an explicit return().
if(x) {
^
<text>:4:10: style: [return_linter] All functions must have an explicit return().
} else if(y) {
^~~~~~~
I'm not entirely sure if it's a bug of this PR or the first one. If it's one of the first, feel free to convert this message into an issue, because then I'll probably have a (simple) solution to fix it and properly handle control statements of any depth.
Originally posted by @MEO265 in #2321 (comment)
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancement