Sha256: 5c6b523a1e60341802e52b515f11bb20dfb02cc28f48889d584234ea8510013f

Contents?: true

Size: 811 Bytes

Versions: 4

Compression:

Stored size: 811 Bytes

Contents

# frozen_string_literal: true

require_relative "helpers"
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 < Linter
      include Helpers
      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

4 entries across 4 versions & 1 rubygems

Version Path
primer_view_components-0.0.52 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.51 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.50 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.49 lib/primer/view_components/linters/label_component_migration_counter.rb