Without this, Typescript is next to useless. Not knowing if the types are good is worse than no types at all.
Without this, Typescript is next to useless. Not knowing if the types are good is worse than no types at all.
You'd need to reach for something like https://typescript-eslint.io/rules/no-explicit-any/
* Common functions such as parsing functions in languages that don't support function overloading
* "equals" and other global functions.Types that are too complex... hmmmm - I'm sure this exists in domains other than the bullshit CRUD apps I write. So yeah, I guess I don't know what I don't know here. I've written some pretty crazy types though, not sure what TypeScript is unable to represent.
I'd be interested in similar capabilities for higher-level tools like static analyzers and so on. The point is not to carry violations long term, but to be able to burn down the violations over time in parallel to new development work.
I want a type that represents a string of negative prime numbers alternating with palindromes, separated by commas.
You could try to craft your own type to match google's schema or hunt down 3rd party types, but just doing `(window as any)["__grecaptcha_cfg"]` gets the job done much faster and it's fairly isolated from the rest of the code so it doesn't matter too much.
But for your own handwritten application code, there is no excuse to use `any`.
Generally, the conveniences of allowing any are swamped by the mess it accumulates in a typical team.