Sha256: 5efffbfde0259ec08839cebdfd979cb099ac622fe8e4379cdc72e78be1b4bd82

Contents?: true

Size: 786 Bytes

Versions: 2

Compression:

Stored size: 786 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 = Yattho::ViewComponents::Constants.get(
        component: "Yattho::Beta::Label",
        constant: "TAG_OPTIONS"
      ).freeze

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yattho_view_components-0.1.1 lib/yattho/view_components/linters/label_component_migration_counter.rb
yattho_view_components-0.0.1 lib/yattho/view_components/linters/label_component_migration_counter.rb