JSFiddle - React, Tailwind, and code Playground
by fiddleyetu
HTML
<ul><li></li></ul>
<ul>
<li>One</li>
</ul>
CSS
ul {
border: 1px solid #c0c0c0;
}
JavaScript
$('ul:has(li:empty)').filter(function() {
return $(this).children().length === 1;
}).remove()