We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 281322a commit e7671e4Copy full SHA for e7671e4
docs/rules/no-top-level-browser-globals.md
@@ -26,18 +26,24 @@ This rule helps prevent the use of browser global variables that can cause error
26
27
/* ✓ GOOD */
28
onMount(() => {
29
- const a = window.localStorage.getItem('myCat');
+ const a = localStorage.getItem('myCat');
30
console.log(a);
31
});
32
33
34
if (browser) {
35
36
+ console.log(a);
37
+ }
38
+
39
+ /* ✓ GOOD */
40
+ if (typeof localStorage !== 'undefined') {
41
42
43
}
44
45
/* ✗ BAD */
46
47
48
</script>
49
```
0 commit comments