AbuseFilter has its own domain-specific language. This language must be learned by admins and maintained by developers.
addEventListener('filter', (event) => ( event.action === 'edit' && event.old_wikitext.length > 0 && event.new_wikitext.length === 0 && !event.user_groups.includes('user') ));
or we could even make the script itself the handler and the event object as the global, which would make it like this:
action === 'edit' && old_wikitext.length > 0 && new_wikitext.length === 0 && !user_groups.includes('user')
Or ideally, both syntax options would be allowed with a config when creating the filter.