Using a meta-language like Typescript (if it's appropriate), and writing a sensible number of tests, employing a consistent code style, documenting what you write, and spending time to actually design your software properly is the answer.
You can write good software in any language and on any platform. Good code is more about your processes than your choice of tools.
Thank you! So many people here blaming the tools for bad software when people have been using horrible tools to write good software for decades. I think one major part of why React + Redux are successful is because they sort of force you into a way of thinking that results in a better creative process and ends with better code.
Maybe it's just me, but when I'm working in React it really forces me into a more "modular" way of writing things. Sure, I'll write something as a huge file that's a couple of hundred lines but React makes it _incredibly_ easy to step back and refactor to start pulling things out into modules.
I guess it doesn't quite _force_ you into thinking a certain way, it just encourages writing code in a more modular and reusable way. Refactoring is easy enough to say "yes, I should pull that out into its own component" vs "it would take me a day to pull this out into its own component".
You can write good software in any language and on any platform. Good code is more about your processes than your choice of tools.