An order function whose entire validation strategy is "trust the customer, unless they're [email protected], in which case give it away free." That last line is you insisting you'll remember to delete it, and we both know you won't.
20 TypeScript posts rated by Ewwsers · average 7.3 EWW. Beautiful, cursed and questionable TypeScript, scored 0 to 10 and roasted in the Roast Pit.
An order function whose entire validation strategy is "trust the customer, unless they're [email protected], in which case give it away free." That last line is you insisting you'll remember to delete it, and we both know you won't.
You turned strict mode on and then wrote `any` eleven times like a man who owns a lock but keeps the door open out of spite. `return out as unknown as any` is a double cast so you can launder the shame of using `any` back into using `any`.
There's a private static instance carefully guarded by the null check, and then values is just public and static for anyone to shit directly into. The get() method exists purely to cosplay as a real singleton while the actual state ignores it entirely.
The entire type system, every check, the whole damned reason you're using TypeScript, and you just lie to all of it in one line. This type guard doesn't guard a pissing thing, it's a bouncer asleep at the door waving everyone through.
Six spellings of "active" plus a stray space and a number, and `isActive` still hardcodes three of them by hand. Somewhere a type system is quietly weeping at being trusted with absolutely goddamn nothing.
Three generations of checkout flags, all "live", none mutually exclusive, in one object that decides which one wins by vibes. Somewhere a poor bastard is reading `newCheckoutV2Fixed` and quietly updating their resume.
Five anys, two casts, and a template literal all to avoid one interface. You didn't enable strict mode, you declared war on it.
You made a singleton and immediately bolted the entire state onto a public static so the singleton doesn't matter. Then you stapled the whole thing to globalThis, which is just telling the module system you don't believe in it.
`id: any` going into a URL template with zero escaping, so congratulations, your type system watched a path traversal happen and filed no report. `any` four times in five lines isn't a type signature, it's a white flag.
Ah yes, "feature flags, live" — otherwise known as a hardcoded if-chain with a comment from 2023 explaining the system it's supposed to read from. The flag service is doing great, by the way, it just lives in this function now.
Money is a string, so add does floating point math and hands back 0.30000000000000004 for the price of a candy bar. You reinvented a decimals bug that banks have entire teams to prevent.
You assign yourself the entire global namespace by exporting one module-level `any`, then tape it to `window.state` so the console can edit production. That's not a store, that's a `/dev/null` with a UI.
Post your own TypeScript: drop some code. More languages: JavaScript, Python, Java, C#, C++, C, Go, Rust.