Based on this answer How do I uninstall a Service Worker? Removing service worker can be done with the bellow code:
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for(let registration of registrations) {
registration.unregister()
} })
When I add it. ESLint has the following error:
error iterators/generators require regenerator-runtime, which is too heavyweight for this guide to allow them. Separately, loops should be avoided in favor of array iterations no-restricted-syntax
Any idea how to rewrite this code to make ESLint not complain?