We were surprised our files linted correctly despite having obvious linting issues, so I have investigated and narrowed it down to this minimal reprex:
# `r print("7")`
function() 2<=3
The above doesn't lint.
I further narrowed the issue down to backticks in combination with r and something because the following do lint correctly:
# `print("7")`
function() 2<=3
# `r`
function() 2<=3
# r print("7")
function() 2<=3
In short - all three are needed: backticks, r and something in addition to r.
Then, I dug inside inflix_spaces_linter and tracked the issue to the parsing function, Given a file "test.R", lintr:::get_source_expressions("test.R") returns:

Without the comment, it parses correctly:

Environment:
lintr version 2.0.1
R: 4.1.0
Is this a known issue?
We were surprised our files linted correctly despite having obvious linting issues, so I have investigated and narrowed it down to this minimal reprex:
The above doesn't lint.
I further narrowed the issue down to backticks in combination with r and something because the following do lint correctly:
In short - all three are needed: backticks, r and something in addition to r.
Then, I dug inside inflix_spaces_linter and tracked the issue to the parsing function, Given a file "test.R",


lintr:::get_source_expressions("test.R")returns:Without the comment, it parses correctly:
Environment:
lintr version 2.0.1
R: 4.1.0
Is this a known issue?