I recall a few years back, Packt et al would publish like "Modern React" or something, with examples that wouldn't build by the time the book was out.
Typesetting is awful too, as you mentioned. A single paragraph for something dead simple is spread over multiple pages.
Nothing against such authors; its fruitless to hit a moving target.
Books on programming languages are the only ones I purchase these days, for those reasons.
The Go book, Rust Programming language, Stroustrup's books on C++ etc are quite good and worth owning, but those are exceptions rather than the rule.