Skip to content

Commit

Permalink
add support for with_content
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhawksley committed Jun 18, 2021
1 parent 74d41d2 commit ac8cb0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/rubocop/cop/github/render_literal_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ module RenderLiteralHelpers
(send nil? {:render :render_to_string} (send _ :new ...) ...)
PATTERN

def_node_matcher :render_view_component_instance_with_content?, <<-PATTERN
(send nil? {:render :render_to_string} (send (send _ :new ...) `:with_content ...))
PATTERN

def_node_matcher :render_view_component_collection?, <<-PATTERN
(send nil? {:render :render_to_string} (send _ :with_collection ...) ...)
PATTERN
Expand All @@ -41,7 +45,8 @@ def hash_with_literal_keys?(hash)
end

def render_view_component?(node)
render_view_component_instance?(node) ||
render_view_component_instance_with_content?(node) ||
render_view_component_instance?(node) ||
render_view_component_collection?(node)
end
end
Expand Down

0 comments on commit ac8cb0b

Please sign in to comment.