Sha256: 71b0b8753e83f5b67ea8749a5b6de2d14a3f7393c714c559867ed8224f88851a

Contents?: true

Size: 780 Bytes

Versions: 137

Compression:

Stored size: 780 Bytes

Contents

# frozen_string_literal: true

require_relative "base_linter"
require_relative "autocorrectable"
require_relative "argument_mappers/clipboard_copy"

module ERBLint
  module Linters
    # Counts the number of times a HTML clipboard-copy is used instead of the component.
    class ClipboardCopyComponentMigrationCounter < BaseLinter
      include Autocorrectable

      TAGS = %w[clipboard-copy].freeze
      REQUIRED_ARGUMENTS = [/for|value/, "aria-label"].freeze
      MESSAGE = "We are migrating clipboard-copy to use [Primer::Beta::ClipboardCopy](https://primer.style/view-components/components/clipboardcopy), please try to use that instead of raw HTML."
      ARGUMENT_MAPPER = ArgumentMappers::ClipboardCopy
      COMPONENT = "Primer::Beta::ClipboardCopy"
    end
  end
end

Version data entries

137 entries across 137 versions & 2 rubygems

Version Path
primer_view_components-0.1.5 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.4 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.3 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.2 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.1 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.123 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.122 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.121 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.120 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.119 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.118 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.117 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.116 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.115 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.114 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.0.113 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb