Skip to content

Commit 65691c2

Browse files
🚨 add a lint rule to forbid declare global usage (#3836)
1 parent c7a22e1 commit 65691c2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎eslint.config.mjs‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ export default tseslint.config(
375375
selector: 'TSEnumDeclaration:not([const=true])',
376376
message: 'When possible, use `const enum` as it produces less code when transpiled.',
377377
},
378+
379+
{
380+
selector: 'TSModuleDeclaration[kind=global]',
381+
message: 'Never declare global types as it will leak to the user app global scope.',
382+
},
378383
],
379384
},
380385
},

0 commit comments

Comments
 (0)