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.64 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.63 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.62 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.61 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.60 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.59 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.58 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.57 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.56 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.55 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.54 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.53 lib/primer/view_components/linters/label_component_migration_counter.rb