noRestrictedGlobals - disallow runtime usage, allow types #7578
osdiab
started this conversation in
Rule suggestion
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I use the ESLint
no-restricted-globals
rule and it specifically only flags runtime usages of globals but not when they're used as types. In my specific use case I don't want people to callnew Date()
(because we have helpers to avoid timezone issues), but I want them to be able in TypeScript to have a function that accepts aDate
(because our helpers still do produceDate
objects). But the Biome implementation ofnoRestrictedGlobals
disallows both the usage at runtime AND as types, and there's no option to configure that; things like this are forcing us to keep ESLint around for certain rules. Would love an option to control this. Thanks!Beta Was this translation helpful? Give feedback.
All reactions