Class: RuboCop::Cop::Primer::DeprecatedLayoutComponent

Inherits:
BaseCop
  • Object
show all
Defined in:
lib/rubocop/cop/primer/deprecated_layout_component.rb

Overview

This cop ensures that the deprecated ‘Primer::LayoutComponent` isn’t used.

bad Primer::LayoutComponent.new(foo: :deprecated)

good Primer::Alpha::Layout.new(foo: :deprecated)

Constant Summary collapse

MSG =
"Please try Primer::Alpha::Layout instead."

Instance Method Summary collapse

Methods inherited from BaseCop

#valid_node?

Instance Method Details

#on_send(node) ⇒ Object



22
23
24
25
26
# File 'lib/rubocop/cop/primer/deprecated_layout_component.rb', line 22

def on_send(node)
  return unless legacy_component?(node)

  add_offense(node, message: MSG)
end