You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
337 B
22 lines
337 B
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;
|
|
};
|