Class: SCSSLint::Linter::TrailingSemicolonAfterPropertyValue
- Inherits:
-
SCSSLint::Linter
- Object
- Sass::Tree::Visitors::Base
- SCSSLint::Linter
- SCSSLint::Linter::TrailingSemicolonAfterPropertyValue
- Includes:
- SCSSLint::LinterRegistry
- Defined in:
- lib/scss_lint/linter/trailing_semicolon_after_property_value.rb
Overview
Checks properties for a trailing semicolon (unless that property is a namespace which has nested properties).
Instance Attribute Summary
Attributes inherited from SCSSLint::Linter
Instance Method Summary collapse
Methods included from SCSSLint::LinterRegistry
extract_linters_from, included
Methods inherited from SCSSLint::Linter
Methods included from Utils
#extract_string_selectors, #node_siblings, #pluralize, #previous_node, #remove_quoted_strings, #same_position?
Methods included from SelectorVisitor
Constructor Details
This class inherits a constructor from SCSSLint::Linter
Instance Method Details
#visit_prop(node) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/scss_lint/linter/trailing_semicolon_after_property_value.rb', line 7 def visit_prop(node) has_nested_props = has_nested_properties?(node) unless has_nested_props if has_space_before_semicolon?(node) line = node.source_range.start_pos.line add_lint line, 'Property declaration should be terminated by a semicolon' elsif !ends_with_semicolon?(node) line = node.source_range.start_pos.line add_lint line, 'Property declaration should not have a space before ' \ 'the terminating semicolon' end end yield if has_nested_props end |