diff --git a/.changeset/polite-oranges-punch.md b/.changeset/polite-oranges-punch.md new file mode 100644 index 00000000..9a2d9f46 --- /dev/null +++ b/.changeset/polite-oranges-punch.md @@ -0,0 +1,5 @@ +--- +"@git-validator/eslint-config": patch +--- + +feat(eslint-config): ban `self` and `global`, prefer `globalThis` diff --git a/packages/eslint-config/src/config/javascript.ts b/packages/eslint-config/src/config/javascript.ts index 057eb447..c58bf1c1 100644 --- a/packages/eslint-config/src/config/javascript.ts +++ b/packages/eslint-config/src/config/javascript.ts @@ -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` ), }, },