Sha256: 6e6d33ef230233e29fea01ea10a3eba26a5b5e5d9fe4df39419167bc3c215799

Contents?: true

Size: 790 Bytes

Versions: 124

Compression:

Stored size: 790 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

124 entries across 124 versions & 2 rubygems

Version Path
openproject-primer_view_components-0.48.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.47.1 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.47.0 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.34.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.46.1 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.46.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.45.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.44.3 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.44.2 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.44.1 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.33.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.44.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.43.1 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.43.0 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.32.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.42.0 lib/primer/view_components/linters/label_component_migration_counter.rb
primer_view_components-0.31.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.41.1 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.41.0 lib/primer/view_components/linters/label_component_migration_counter.rb
openproject-primer_view_components-0.40.0 lib/primer/view_components/linters/label_component_migration_counter.rb