Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Disable no-var on globals.d.ts #91

Open
fregante opened this issue Oct 18, 2024 · 1 comment
Open

Disable no-var on globals.d.ts #91

fregante opened this issue Oct 18, 2024 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@fregante
Copy link
Member

To create globals available on globalThis, you must use var: https://stackoverflow.com/a/56984941/288906

What do you think about adding an exclusion for files named global.d.ts and globals.d.ts?

A proper fix for this would have to use the TypeScript parser to determine when var is being used inside a declare global in any file, or on the top-level in environment types… but this means creating a whole new no-var rule. I think this included exception would be a good compromise to avoid so much confusion.

@fregante fregante added the enhancement New feature or request label Oct 18, 2024
@sindresorhus
Copy link
Member

👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants