Sha256: b9cdc3a316a8a4e1955e715bcd14672982842005fdf4170a269c1ac14c76140a

Contents?: true

Size: 797 Bytes

Versions: 52

Compression:

Stored size: 797 Bytes

Contents

# frozen_string_literal: true

require_relative "base_linter"
require_relative "autocorrectable"
require_relative "argument_mappers/label"

module ERBLint
  module Linters
    # Counts the number of times a HTML label is used instead of the component.
    class LabelComponentMigrationCounter < BaseLinter
      include Autocorrectable

      TAGS = Primer::ViewComponents::Constants.get(
        component: "Primer::LabelComponent",
        constant: "TAG_OPTIONS"
      ).freeze

      CLASSES = %w[Label].freeze
      MESSAGE = "We are migrating labels to use [Primer::LabelComponent](https://primer.style/view-components/components/label), please try to use that instead of raw HTML."
      ARGUMENT_MAPPER = ArgumentMappers::Label
      COMPONENT = "Primer::LabelComponent"
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
primer_view_components-0.0.104 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.103 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.102 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.101 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.100 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.99 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.98 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.97 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.96 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.95 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.94 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.93 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.92 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.91 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.90 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.89 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.88 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.87 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.86 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.85 lib/primer/view_components/linters/label_component_migration_counter.rb