Case sensitivity has changed between eslint-plugin-compat 6.2.0 and 7.0.0 in ways that can result in false positives.
6.2.0 reported no issues for the following:
import * as serviceWorker from './serviceWorker.ts';
serviceWorker.register(false);
7.0.0 gives the following error:
ServiceWorker is not supported in op_mini all, KaiOS 2.5, android 145
This isn't a reference to the ServiceWorker global - it's my own serviceWorker variable. Case sensitivity matters; eslint-plugin-compat shouldn't confuse the two. I believe that the fix in #681 is far too aggressive: the browser crypto global variable is an instance of the Crypto class, but there are plenty of other DOM API classes that do not follow this pattern (like ServiceWorker).
As another example:
if (!navigator.permissions) {
return;
}
// eslint-disable-next-line compat/compat
navigator.permissions
.query({ name: 'local-network-access' })
.then((permissionStatus) => {
permissionStatus.addEventListener('change', handleChange);
})
I expect that I may have to suppress eslint-plugin-compat's warning when accessing navigator.permissions. However, starting with eslint-plugin-compat 7.0.0, I also have to suppress warnings about using my local permissionStatus variable, just because it happens to have the same name as a PermissionStatus interface that isn't globally recognized.
Case sensitivity has changed between eslint-plugin-compat 6.2.0 and 7.0.0 in ways that can result in false positives.
6.2.0 reported no issues for the following:
7.0.0 gives the following error:
This isn't a reference to the
ServiceWorkerglobal - it's my ownserviceWorkervariable. Case sensitivity matters; eslint-plugin-compat shouldn't confuse the two. I believe that the fix in #681 is far too aggressive: the browsercryptoglobal variable is an instance of theCryptoclass, but there are plenty of other DOM API classes that do not follow this pattern (likeServiceWorker).As another example:
I expect that I may have to suppress eslint-plugin-compat's warning when accessing
navigator.permissions. However, starting with eslint-plugin-compat 7.0.0, I also have to suppress warnings about using my localpermissionStatusvariable, just because it happens to have the same name as aPermissionStatusinterface that isn't globally recognized.