What is $item? What does it contain? I have no idea, and to find out, I have to dig through at least five files (so far) to figure out how it's put together.
As someone working on a team with a large monorepo with strict type requirements, I will say my life is a lot easier with types than without. Types are documentation plain and simple, they require devs to state their intentions in code which is extremely valuable for other devs on the project.
Type safety is just one such method. The actual problem is making code easier to maintain for humans. Type safety is not always the best means to that end. Our brains perceive information in a complicated way. Sometimes too much information can overwhelm us and obfuscate something simple. Sometimes too much detail about each value can make us lose the overall flow of the program.
My advice: (aside from reading other people's code) try to read what you wrote, and have others read what you wrote in code reviews. Do you and your colleagues understand it? Make it as brief and simple as possible without losing that understanding. Address any "how" questions by rewriting the code clearer, "what" questions by improving naming, and "why" questions by adding comments. These are your code's 3 primary objectives: explaining how, what, and why to your colleagues. I once wrote a post about it.[1]
This is what parsers are for (in TS: zod, valibot, joi, yup et al). Preferably those that can express type definitions for their output that matches the runtime validation.
You can't have type-safety without untrusted input parsing.
Air doesn't matter! It's only useful because of what our bodies do with it
Edit: I'm a bit triggered. I don't get how this trivial example showcases anything. You always use types. They are either written down or in your mind. Unfortunately, collaboration happens, and I'm not in your mind.
[0]: https://news.ycombinator.com/item?id=40165904