Skip to content

Commit

Permalink
🐛 Fix mixin before declaration issues
Browse files Browse the repository at this point in the history
Add check for declaration node content type
Fixes sasstools#227
Fixes sasstools#230
  • Loading branch information
DanPurdy committed Oct 1, 2015
1 parent 21f7821 commit 63a451e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/rules/mixins-before-declarations.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ module.exports = {
var depth = 0,
declarationCount = [depth];

parent.traverse( function (item) {
parent.forEach( function (item) {
if (item.type === 'ruleset') {
depth++;
declarationCount[depth] = 0;
}
else if (item.type === 'declaration') {
declarationCount[depth]++;
if (item.first().is('property')) {

var prop = item.first();

if(prop.first().is('ident')) {

declarationCount[depth]++;

}
}
}
else if (item.type === 'include') {
item.forEach('simpleSelector', function (name) {
Expand Down

0 comments on commit 63a451e

Please sign in to comment.