Skip to content

Commit

Permalink
Do not require every extend is matched inside every media query and d…
Browse files Browse the repository at this point in the history
…irective - removes alot of false warnings. Fixes #2499
  • Loading branch information
lukeapage committed Feb 26, 2015
1 parent 4492a3a commit 95441fa
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions lib/less/visitors/extend-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ ProcessExtendsVisitor.prototype = {
},
visitMediaOut: function (mediaNode) {
var lastIndex = this.allExtendsStack.length - 1;
this.checkExtendsForNonMatched(this.allExtendsStack[lastIndex]);
this.allExtendsStack.length = lastIndex;
},
visitDirective: function (directiveNode, visitArgs) {
Expand All @@ -446,7 +445,6 @@ ProcessExtendsVisitor.prototype = {
},
visitDirectiveOut: function (directiveNode) {
var lastIndex = this.allExtendsStack.length - 1;
this.checkExtendsForNonMatched(this.allExtendsStack[lastIndex]);
this.allExtendsStack.length = lastIndex;
}
};
Expand Down

2 comments on commit 95441fa

@bassjobsen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The situation for @media rules is possible more complex, the current fix does not throw a warning for the following code:

@media print {
.not {
p:2;
}
p2{
&:extend(.not2);
}
}

expected extend ' .not2' has no matches

@lukeapage
Copy link
Member Author

@lukeapage lukeapage commented on 95441fa Feb 28, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.