securityos/node_modules/stylelint-order/rules/properties-order/hasEmptyLineBefore.js

22 lines
337 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
module.exports = function hasEmptyLineBefore(decl) {
if (/\r?\n\s*\r?\n/.test(decl.raw('before'))) {
return true;
}
const prevNode = decl.prev();
if (!prevNode) {
return false;
}
if (prevNode.type !== 'comment') {
return false;
}
if (/\r?\n\s*\r?\n/.test(prevNode.raw('before'))) {
return true;
}
return false;
};