Skip to content

Commit

Permalink
Merge pull request #9 from ueokande/fix_border_zero
Browse files Browse the repository at this point in the history
Fix convention on border-zero rule
  • Loading branch information
benthemonkey authored Dec 8, 2016
2 parents 3aebbb2 + 9078842 commit 1723a45
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ describe('Rule Conversion', function () {
}
}).rules,
{
'border-zero': [1, { convention: 'zero' }]
'border-zero': [1, { convention: '0' }]
}
);

Expand Down
16 changes: 12 additions & 4 deletions translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ module.exports.BemDepth = {
};

module.exports.BorderZero = {
name: 'border-zero',
options: {
convention: {
name: 'convention'
special_case: function (linterValue, sassSettings, severity) {
if (linterValue.hasOwnProperty('convention')) {
var convention = linterValue.convention;
if (convention === 'zero') {
sassSettings.rules['border-zero'] = [severity, { convention: '0' }];
}
else {
sassSettings.rules['border-zero'] = [severity, { convention: convention }];
}
}
else {
sassSettings.rules['border-zero'] = severity;
}
}
};
Expand Down

0 comments on commit 1723a45

Please sign in to comment.