Sha256: aacb2a17c6a31f920ae5f9d9bb48fa40e2c87ff5902ce96a66e4626de019212a

Contents?: true

Size: 788 Bytes

Versions: 33

Compression:

Stored size: 788 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::Beta::Label",
        constant: "TAG_OPTIONS"
      ).freeze

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

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
primer_view_components-0.4.0 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.3.1 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.3.0 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.2.0 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.9 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.8 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.7 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.6 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.5 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.4 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.3 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.2 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.1 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.1.0 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.123 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.122 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.121 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.120 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.119 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.0.118 lib/primer/view_components/linters/label_component_migration_counter.rb