lib/scss_lint/sass/tree.rb in scss_lint-0.55.0 vs lib/scss_lint/sass/tree.rb in scss_lint-0.56.0

- old
+ new

@@ -9,19 +9,10 @@ # Define some common helper code for use in the various monkey patchings. class Node # Stores node for which this node is a direct child attr_accessor :node_parent - # The `args` field of some Sass::Tree::Node classes returns - # Sass::Script::Variable nodes with no line numbers. This adds the line - # numbers back in so lint reporting works for those nodes. - def add_line_numbers_to_args(arg_list) - arg_list.each do |variable, _default_expr| - add_line_number(variable) - end - end - # The Sass parser sometimes doesn't assign line numbers in cases where it # should. This is a helper to easily correct that. def add_line_number(node) node.line ||= line if node.is_a?(::Sass::Script::Tree::Node) node @@ -94,12 +85,10 @@ end end class FunctionNode def children - add_line_numbers_to_args(args) - concat_expr_lists super, args, splat end end class IfNode @@ -108,20 +97,16 @@ end end class MixinDefNode def children - add_line_numbers_to_args(args) - concat_expr_lists super, args, splat end end class MixinNode def children - add_line_numbers_to_args(args) - # Keyword mapping is String -> Expr, so convert the string to a variable # node that supports lint reporting if keywords.any? keyword_exprs = keywords.as_stored.map do |var_name, var_expr| [create_variable(var_name), var_expr] @@ -132,9 +117,11 @@ end end class PropNode def children + # TODO: fix custom properties + return [] if custom_property? concat_expr_lists super, extract_script_nodes(name), add_line_number(value) end end class ReturnNode