Skip to content

Commit

Permalink
🐛 Fix missing string type from value checker
Browse files Browse the repository at this point in the history
  • Loading branch information
DanPurdy committed Aug 25, 2016
1 parent c3a0260 commit 6fff0a0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 15 deletions.
8 changes: 7 additions & 1 deletion lib/rules/shorthand-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,13 @@ var scanValue = function (node) {
fullVal += '#' + val.content + '';
}

else if (val.is('operator') || val.is('ident') || val.is('number') || val.is('unaryOperator')) {
else if (
val.is('operator') ||
val.is('ident') ||
val.is('number') ||
val.is('unaryOperator') ||
val.is('string')
) {
fullVal += val.content;
}

Expand Down
28 changes: 14 additions & 14 deletions tests/rules/shorthand-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('shorthand values - scss', function () {
lint.test(file, {
'shorthand-values': 1
}, function (data) {
lint.assert.equal(77, data.warningCount);
lint.assert.equal(78, data.warningCount);
done();
});
});
Expand Down Expand Up @@ -44,7 +44,7 @@ describe('shorthand values - scss', function () {
}
]
}, function (data) {
lint.assert.equal(39, data.warningCount);
lint.assert.equal(40, data.warningCount);
done();
});
});
Expand All @@ -60,7 +60,7 @@ describe('shorthand values - scss', function () {
}
]
}, function (data) {
lint.assert.equal(46, data.warningCount);
lint.assert.equal(47, data.warningCount);
done();
});
});
Expand Down Expand Up @@ -92,7 +92,7 @@ describe('shorthand values - scss', function () {
}
]
}, function (data) {
lint.assert.equal(58, data.warningCount);
lint.assert.equal(59, data.warningCount);
done();
});
});
Expand All @@ -109,7 +109,7 @@ describe('shorthand values - scss', function () {
}
]
}, function (data) {
lint.assert.equal(65, data.warningCount);
lint.assert.equal(66, data.warningCount);
done();
});
});
Expand All @@ -126,7 +126,7 @@ describe('shorthand values - scss', function () {
}
]
}, function (data) {
lint.assert.equal(58, data.warningCount);
lint.assert.equal(59, data.warningCount);
done();
});
});
Expand All @@ -144,7 +144,7 @@ describe('shorthand values - scss', function () {
}
]
}, function (data) {
lint.assert.equal(77, data.warningCount);
lint.assert.equal(78, data.warningCount);
done();
});
});
Expand All @@ -161,7 +161,7 @@ describe('shorthand values - sass', function () {
lint.test(file, {
'shorthand-values': 1
}, function (data) {
lint.assert.equal(77, data.warningCount);
lint.assert.equal(78, data.warningCount);
done();
});
});
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('shorthand values - sass', function () {
}
]
}, function (data) {
lint.assert.equal(39, data.warningCount);
lint.assert.equal(40, data.warningCount);
done();
});
});
Expand All @@ -209,7 +209,7 @@ describe('shorthand values - sass', function () {
}
]
}, function (data) {
lint.assert.equal(46, data.warningCount);
lint.assert.equal(47, data.warningCount);
done();
});
});
Expand Down Expand Up @@ -241,7 +241,7 @@ describe('shorthand values - sass', function () {
}
]
}, function (data) {
lint.assert.equal(58, data.warningCount);
lint.assert.equal(59, data.warningCount);
done();
});
});
Expand All @@ -258,7 +258,7 @@ describe('shorthand values - sass', function () {
}
]
}, function (data) {
lint.assert.equal(65, data.warningCount);
lint.assert.equal(66, data.warningCount);
done();
});
});
Expand All @@ -275,7 +275,7 @@ describe('shorthand values - sass', function () {
}
]
}, function (data) {
lint.assert.equal(58, data.warningCount);
lint.assert.equal(59, data.warningCount);
done();
});
});
Expand All @@ -293,7 +293,7 @@ describe('shorthand values - sass', function () {
}
]
}, function (data) {
lint.assert.equal(77, data.warningCount);
lint.assert.equal(78, data.warningCount);
done();
});
});
Expand Down
7 changes: 7 additions & 0 deletions tests/sass/shorthand-values.sass
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,10 @@

.test
border-color: transparent #095b97 transparent #095b97

// Issue #847 - Ignoring function arguments
.foo
padding: 0 size('half-shim') 0 size('spacer')

.foo
padding: 0 size('half-shim') 0 size('half-shim')
9 changes: 9 additions & 0 deletions tests/sass/shorthand-values.scss
Original file line number Diff line number Diff line change
Expand Up @@ -369,3 +369,12 @@
.test {
border-color: transparent #095b97 transparent #095b97;
}

// Issue #847 - Ignoring function arguments
.foo {
padding: 0 size('half-shim') 0 size('spacer');
}

.foo {
padding: 0 size('half-shim') 0 size('half-shim');
}

0 comments on commit 6fff0a0

Please sign in to comment.