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.84 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.83 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.82 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.81 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.80 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.79 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.78 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.77 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.76 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.75 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.74 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.73 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.72 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.71 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.70 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.69 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.68 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.67 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.66 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.65 lib/primer/view_components/linters/label_component_migration_counter.rb