Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control the behaviour of lintr in Visual Studio Code?

Switching from Rstudio to VS Code. Biggest problem right now: the linters are constantly bothering me! Take the snippet as an example:

enter image description here

object_name_linter is trying to make me name my variable as group_markers instead of group.markers. However, in the R community, it's rather common to see . within variable names. I couldn't figure out a good way to turn off this linter.

like image 450
Jerry Fan Avatar asked Dec 30 '25 23:12

Jerry Fan


1 Answers

To turn off this specific linter globally, create a config file ~/.lintr

linters: with_defaults(
    object_name_linter = NULL
  )

A list of linters: https://lintr.r-lib.org/reference/linters.html

For example, to also disable the linter for maximum line length = 80, the config file ~/.lintr should be:

linters: with_defaults(
    object_name_linter = NULL,
    line_length_linter = NULL
  )
like image 158
Feng Mai Avatar answered Jan 02 '26 12:01

Feng Mai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!