Enable `no-throw-literal`
https://typescript-eslint.io/rules/no-throw-literal
A lot of code seems to depend on the fact that any thrown error is at least some form of Error, so this'd help remove the possibility for undefined bugs.
We'll probably also want to add the option "allowThrowingAny": false
Why?
As described in https://github.com/matrix-org/matrix-js-sdk/issues/2116#issuecomment-1020545233 (at the bottom, header useUnknownInCatchVariables), handling thrown values in catch requires to treat it as anything unknown, this is because anything can be thrown, and this lint helps present this.
I think, in a large library such as this, throwing a literal value is an antipattern, as the library works and deals with Errors anywhere, having a lint which prevents developers throwing any literal value would help conform error-throwing to Errors (mostly) only, and no singleton nonsensical or context-less values such as strings, numbers, undefineds, and nulls.
This lint also has options to disallow throwing any or unknown, as these could be non-object values.
Reasons explaining why any should be prohibited anywhere is outlined in https://github.com/matrix-org/matrix-js-sdk/issues/2115, while unknown should very likely still be allowed, as with useUnknownInCatchVariables, re-throwing is also common, and with that linter, es in catch(e)s would be unknown.