Skip to content

Conflict warning with lintr #338

Open

Description

@jhk0530

Hi, sorry for weird question.

After installing and running the air extension in vscode, the results from air and the results from lintr conflict and generate a warning.

How can I resolve this issue without uninstalling air extension?

Thanks

Image

Activity

  1. lionel- commented on May 9, 2025

    @lionel-
    Collaborator

    It looks like the only options are turning of languageserver's diagnostics altogether, or configuring ~/.lintr:
    https://stackoverflow.com/questions/68858490/disable-r-linting-in-vscode

    Since lintr is an out-of-the-box feature of languageserver and vscode-R, we should mention this issue in Air's documentation for VS Code.

  2. DavisVaughan commented on May 9, 2025

    @DavisVaughan
    Collaborator

    I imagine this is happening because VS Code / Positron default to 4 spaces for R code, and the forward propagation tries to respect that until you create a project with an actual air.toml file.

    If you're working in a project and create an empty air.toml file at the project root, then Air will start using 2 spaces (its default) rather than trying to respect the 4 space default that VS Code is trying to give you

  3. jhk0530 commented on May 18, 2025

    @jhk0530
    Author

    I solved this issue with step below

    1. Remove R extension in vscode which includes lintr. since I run R code in Rstudio, it's fine.
    2. Activate Air extension in vscode

    Now I'm enjoying air in vscode well. Thank you all

  4. grantmcdermott commented on Jun 5, 2025

    @grantmcdermott

    I don't think this issue should be closed, given that the air documentation hasn't been updated yet per @lionel-'s comment.

  5. grantmcdermott commented on Oct 2, 2025

    @grantmcdermott

    Quick follow-up on this:

    Unfortunately, I have been unable to get air working in VS Code due to the continuing lintr conflict. In my case, I am simply unable to turn lintr off through the recommended "r.lsp.diagnostics": false setting. There's actually an upvoted comment on this very problem in the link that @lionel- provided above. (The issue was supposedly fixed here, but from a quick inspection of the related issue thread(s), I'm not the only person still struggling with it.)

    Regardless---and while this obviously isn't air's fault---I do think a more explicit note/caveat in the documentation would be helpful.

  6. DavisVaughan commented on Oct 3, 2025

    @DavisVaughan
    Collaborator

    @grantmcdermott can't you individually turn off the indentation and line length linters?

  7. grantmcdermott commented on Oct 3, 2025

    @grantmcdermott

    @DavisVaughan ya, those seem to work just fine. (I was/am using the second example here.) I have no idea why these overrides work, but setting "r.lsp.diagnostics": false doesn't ¯_(ツ)_/¯

    Again, probably not much that you can do on the air side beyond a note in the documentation.

    Cheers

  8. DavisVaughan commented on Oct 4, 2025

    @DavisVaughan
    Collaborator

    A few other workarounds / solutions to look at

    Most interesting is options(languageserver.diagnostics = FALSE) in .Rprofile if we were going to document something?

  9. eitsupi commented on Sep 22, 2026

    @eitsupi

    IMO this should be fixed on the vscode-R side.
    Please vote REditorSupport/vscode-R#1749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions