People come to me because they acknowledge that they don't understand the problems they are faced with, and I provide maintainable solutions that work for years after the contract has been completed.
How?
I choose a widely adopted framework that is suited to the task and follow the best practices of the community that developed it.
That way when I leave people don't say my app is "A spaghetti be-spoke js app" but instead "Its an angular/ember/react-redux app." See the difference?
One is the opinions of a single developer (or small team), the other is the culmination of hundreds of open source developers working together to solve common problems in a maintainable and performant way.