A-10 has considerable operating environment limitations. It's only applicable now to "low and moderately contested airspace." In "highly contested" airspace, A-10 gets smoked. The comparison tests that have been released to the public only compare the two in low and moderately contested airspace. No question, A-10 holds its own and is a far cheaper solution for the police wars of the past 35 years. But, that isn't the defense scenario you plan for the future.
The compromise (traditional US defense policy) has been to go the hi-tech, expensive (per unit) route, with F-35 stretched into multiple roles, as the F-16, F-18 and F-15 were eventually (all fighters, that added bomb truck variants). At least F-35 was designed as an attack plane from the beginning.
Most of the problem with CAS hasn't been the weapons themselves but the traditional 'difficulties' with command & control system coordination between services (both technical and institutional cooperation). You can argue that having a dedicated USAF CAS aircraft like A-10 "forced" better cooperation and integration.
I grew up near the A-10 factory and love the design as an aircraft, but, its usefulness is becoming narrow. People have a hard time getting their heads around F-35. It's (mostly) an invisible attack aircraft. And, that MFer kills in ways you didn't know you could die.