Skip to content

Commit

Permalink
feat(eslint-config): ban self and global, prefer globalThis
Browse files Browse the repository at this point in the history
  • Loading branch information
zanminkian committed Sep 18, 2024
1 parent 5b49895 commit 6ceacd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/polite-oranges-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@git-validator/eslint-config": patch
---

feat(eslint-config): ban `self` and `global`, prefer `globalThis`
6 changes: 3 additions & 3 deletions packages/eslint-config/src/config/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,9 @@ export function javascript() {
},
globals: {
...Object.fromEntries(
Object.entries(globals.browser).filter(
([k]) => !confusingKeys.includes(k),
),
Object.entries(globals.browser)
.filter(([k]) => !confusingKeys.includes(k))
.filter(([k]) => !["self", "global"].includes(k)), // prefer `globalThis`
),
},
},
Expand Down

0 comments on commit 6ceacd8

Please sign in to comment.