Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ const SIDE_EFFECT_METHODS = new Set([
"content_for",
"provide",
"flush",
"turbo_refreshes_with",
"turbo_exempts_page_from_cache",
"turbo_exempts_page_from_preview",
"turbo_page_requires_reload",
])

class UnusedExpressionCollector extends PrismVisitor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ describe("ERBNoUnusedExpressionsRule", () => {
`)
})

test("passes for Turbo helpers", () => {
expectNoOffenses(dedent`
<% turbo_refreshes_with method: :morph, scroll: :preserve %>
<% turbo_exempts_page_from_cache %>
<% turbo_exempts_page_from_preview %>
<% turbo_page_requires_reload %>
`)
})

test("passes for ERB comments", () => {
expectNoOffenses(dedent`
<%# This is a comment %>
Expand Down
Loading