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
openproject-primer_view_components-0.10.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.9.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
openproject-primer_view_components-0.9.1 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
openproject-primer_view_components-0.9.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
openproject-primer_view_components-0.8.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.8.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.7.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
openproject-primer_view_components-0.7.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
openproject-primer_view_components-0.6.3 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.6.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.5.1 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.5.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.4.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.3.1 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.3.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.2.0 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.9 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.8 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.7 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb
primer_view_components-0.1.6 lib/primer/view_components/linters/clipboard_copy_component_migration_counter.rb