epiphany/node_modules/stylelint-order/rules/properties-order/hasEmptyLineBefore.js
2023-12-09 22:48:07 -08:00

21 lines
337 B
JavaScript

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;
};