2

Most of the people I work with use the camelCase notation and every time I open an R file get a swarm of linters, which are annoying. How can I disable them? I always get something of the kind:

Variable and function name style should be snake_case.object_name_linter

I know one can disable them manually using the # nolint at the end of the line, but I want to know if I can change it in general, in the settings, or something.

leplata
  • 123
  • 5

1 Answers1

3

To remove those linters when using R in VSCode you will just need to create a linter file.

Within your workspace (there is a way to do this globally, but I can't remember. If I find it I'll update) create a new file called, ".lintr"

Within that file you want it to follow this format:

linters: with_defaults(
  camel_case_linter = NULL,
  THE_LINTER_YOU_DON'T_WANT = Null
  )
exclude: "# Exclude Linting"
exclude_start: "# Begin Exclude Linting"
exclude_end: "# End Exclude Linting"
encoding: "ISO-8859-1"

That should be it!

Also here is a rough list of most of the linters if you want to disable them all;

  absolute_path_linter = NULL,
  assignment_linter = NULL,
  assignment_spaces_linter = NULL,
  backport_linter = NULL,
  camel_case_linter = NULL,
  closed_curly_linter = NULL,
  commas_linter = NULL,
  commented_code_linter = NULL,
  cyclocomp_linter = NULL,
  duplicate_argument_linter = NULL,
  equals_na_linter = NULL,
  function_left_parentheses_linter = NULL,
  implicit_integer_linter = NULL,
  infix_spaces_linter = NULL,
  line_length_linter = NULL,
  missing_argument_linter = NULL,
  namespace_linter = NULL,
  no_tab_linter = NULL,
  nonportable_path_linter = NULL,
  object_length_linter = NULL,
  object_name_linter = NULL,
  object_usage_linter = NULL,
  open_curly_linter = NULL,
  paren_body_linter = NULL,
  paren_brace_linter = NULL,
  pipe_call_linter = NULL,
  pipe_continuation_linter = NULL,
  semicolon_terminator_linter = NULL,
  single_quotes_linter = NULL,
  spaces_inside_linter = NULL,
  spaces_left_parentheses_linter = NULL,
  sprintf_linter = NULL,
  todo_comment_linter = NULL,
  trailing_blank_lines_linter = NULL,
  trailing_whitespace_linter = NULL,
  unneeded_concatenation_linter = NULL,
  seq_linter = NULL
Mi-krater
  • 299
  • 1
  • 3
  • 16