Class: ERBLint::Linters::DeprecatedClasses
- Inherits:
-
ERBLint::Linter
- Object
- ERBLint::Linter
- ERBLint::Linters::DeprecatedClasses
- Includes:
- ERBLint::LinterRegistry
- Defined in:
- lib/erb_lint/linters/deprecated_classes.rb
Overview
Checks for deprecated classes in the start tags of HTML elements.
Constant Summary
Constants included from ERBLint::LinterRegistry
ERBLint::LinterRegistry::CUSTOM_LINTERS_DIR
Instance Method Summary collapse
-
#initialize(config) ⇒ DeprecatedClasses
constructor
A new instance of DeprecatedClasses.
Methods included from ERBLint::LinterRegistry
Methods inherited from ERBLint::Linter
Constructor Details
#initialize(config) ⇒ DeprecatedClasses
Returns a new instance of DeprecatedClasses.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/erb_lint/linters/deprecated_classes.rb', line 9 def initialize(config) @deprecated_ruleset = [] config.fetch('rule_set', []).each do |rule| suggestion = rule.fetch('suggestion', '') rule.fetch('deprecated', []).each do |class_expr| @deprecated_ruleset.push( class_expr: class_expr, suggestion: suggestion ) end end @deprecated_ruleset.freeze @addendum = config.fetch('addendum', '') end |