# will produce lints
lint(
text = 'ifelse(x == "a", 1L, ifelse(x == "b", 2L, 3L))',
linters = nested_ifelse_linter()
)
# okay
lint(
text = 'dplyr::case_when(x == "a" ~ 1L, x == "b" ~ 2L, TRUE ~ 3L)',
linters = nested_ifelse_linter()
)
lint(
text = 'data.table::fcase(x == "a", 1L, x == "b", 2L, default = 3L)',
linters = nested_ifelse_linter()
)
Run the code above in your browser using DataLab