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 @@ -12,9 +12,9 @@ class FlashMigrationCounter < BaseLinter

TAGS = %w[div].freeze
CLASSES = %w[flash].freeze
MESSAGE = "We are migrating flashes to use [Primer::Beta::Flash](https://primer.style/view-components/components/beta/flash), please try to use that instead of raw HTML."
MESSAGE = "We are migrating flashes to use [Primer::Alpha::Banner](https://primer.style/view-components/components/alpha/banner), please try to use that instead of raw HTML."
ARGUMENT_MAPPER = ArgumentMappers::Flash
COMPONENT = "Primer::Beta::Flash"
COMPONENT = "Primer::Alpha::Banner"

def map_arguments(tag, tag_tree)
# We can only autocorrect elements with simple text as content.
Expand Down
2 changes: 1 addition & 1 deletion test/lib/erblint/flash_migration_counter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_suggests_how_to_use_the_component_with_arguments
@file = "<div class=\"flash flash-warn flash-full\">flash</div>"
@linter.run(processed_source)

assert_includes(offenses.first.message, "render Primer::Beta::Flash.new(scheme: :warning, full: true)")
assert_includes(offenses.first.message, "render Primer::Alpha::Banner.new(scheme: :warning, full: true)")
end

def test_does_not_autocorrect_with_html_content
Expand Down
Loading