Class: RuboCop::Cop::Migrations::IconButtonComponent
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Migrations::IconButtonComponent
- Extended by:
- AutoCorrector
- Defined in:
- lib/primer/view_components/linters/migrations/iconbutton_component.rb
Overview
Lint and autocorrect deprecated IconButton
Constant Summary collapse
- INVALID_MESSAGE =
<<~STR `Primer::IconButton` is deprecated. Please use `Primer::Beta::IconButton` instead. STR
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/primer/view_components/linters/migrations/iconbutton_component.rb', line 21 def on_send(node) return unless (node) add_offense(node, message: INVALID_MESSAGE) do |corrector| next if hash_with_box_value?(node.arguments.first) corrector.replace((node), "Primer::Beta::IconButton") end end |