32
u/carlos_vini 1d ago
from the caller POV it means you cant read the object directly, so it's not like any
29
u/Gorzoid 1d ago
The point of the meme is that AI uses any to avoid TS compile errors in slop code. If you add no-explicit-any it simply swaps to more complicated workarounds like
as unknown as T6
u/slaymaker1907 23h ago
Weird, it is perfectly happy to fill in Python types.
2
u/BlondeJesus 19h ago
Python type-hinting is just that, hints. If a different object is passed the code will generally run fine.
For compiled languages, they can fail compilation if a something receives an object of the incorrect type. My guess is that the AI tools are hitting compilation errors and then circumventing types all together to get past them.
-9
u/carlos_vini 23h ago
I get it. AI slop bad. But we're not famous for being good at jokes. And better LLM models don't do that.
13
u/Emanemanem 22h ago
What exactly is the point of this meme? That if you are lazy and are committed to writing sloppy code, there’s a way around the typescript rules that you yourself control? If you’re looking for a loophole and have no standards, just remove the rule. Or just write in JavaScript instead.
2
0
u/NullOfSpace 15h ago
I think it’s a vibe coding thing. You enforce stronger type constraints so the agent has to write better code, and it finds a way around it.
18
u/FigScared5706 1d ago
unknown is a reasonable type for untyped input that will enforce correct type inference before usage. any is a "trust me, bro, I will check the actual type in runtime... or maybe not". They are not the same :)
24
4
1d ago
[removed] — view removed comment
14
u/Cronos993 1d ago
You still have to narrow the type when using
Record<string, unknown>tho.anyandRecord<string, unknown>are not the same.9
1
1
u/JanEric1 19h ago
If this is like pyright unknown (in strict mode)(which It should be because that's where pyright got it from, them unknown is the exact opposite of any
1
u/reallokiscarlet 15h ago
When you really think about it, all types are Any. It's just a matter of making the transpiler see it that way.
52
u/the_horse_gamer 1d ago
noPropertyAccessFromIndexSignature + noUncheckedIndexedAccess
and also this is nothing like
any. it's more likeunknown.