# will produce lints
code_lines <- "library(dplyr)\n1 + 1"
writeLines(code_lines)
lint(
text = code_lines,
linters = unused_import_linter()
)
code_lines <- "library(dplyr)\ndplyr::tibble(a = 1)"
writeLines(code_lines)
lint(
text = code_lines,
linters = unused_import_linter()
)
# okay
code_lines <- "library(dplyr)\ntibble(a = 1)"
writeLines(code_lines)
lint(
text = code_lines,
linters = unused_import_linter()
)
code_lines <- "library(dplyr)\ndplyr::tibble(a = 1)"
writeLines(code_lines)
lint(
text = code_lines,
linters = unused_import_linter(allow_ns_usage = TRUE)
)
Run the code above in your browser using DataLab