Sha256: d4855c276d1db782858b23da02f5173562108e4d4b2e87d7658e83501654aaf0

Contents?: true

Size: 709 Bytes

Versions: 1

Compression:

Stored size: 709 Bytes

Contents

require 'sass'

module SCSSLint
  class Linter::PropertyFormatLinter < Linter
    include LinterRegistry

    class << self
      def run(engine)
        lints = []
        engine.tree.each do |node|
          if node.is_a?(Sass::Tree::PropNode)
            lints << check_property_format(node, engine.lines[node.line - 1]) if node.line
          end
        end
        lints.compact
      end

      def description
        'Property declarations should always be on one line of the form ' <<
        '`property-name: value;`'
      end

    private

      def check_property_format(prop_node, line)
        return create_lint(prop_node) unless line =~ /^\s*[\w-]+: [^\s][^;]*;/
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
scss-lint-0.1 lib/scss_lint/linter/property_format_linter.rb