| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
why isn’t Function treated as a top type similar to (...args: never) => unknown? |
Sorry, something went wrong.
Presumably exactly for the reason I gave; (...args: never) => unknown can't be new-d but Function can. But, I'm not a total expert on why. I definitely read something about this in the past year but it's hard to find when the only term I can use is "function". |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Follow-up to #54693.
All of the things it catches are harmless, realistically, though I agree that as Function was the wrong cast as that'd let us accidentally new it or something.
I definitely disagree with the default of banning {}; that's a very useful type (especially post #49119, a number I have memorized at this point). Annoyingly, violating the rule that bans {} or Object says to use NonNullable<unknown> which is exactly {}.
The fact that Symbol is mistaken as the global Symbol I believe is a bug in ts-eslint, though I don't think it's reported so I'll do that shortly. typescript-eslint/typescript-eslint#7306
Disabling those two leaves the rule to only ban the uppercase primitive wrapper types (good) and Object (probably good), so it seems like this rule is fine to keep enabled.