I personally also found carrier spam to be an issue until I modified both my fleet composition and way I play battles against a lot of carriers.
The first thing you need to do is to not have your units wander off by themselves. A carrier lives and dies by its ability to pick the enemy off one by one and you must not make it easier for the enemy to do that.
The second thing is proper fleet composition logic. All my capitals are more or less PD bastions for my forces to anchor around. It gets even better if your capitals also have an aggressive officer making them naturally more prone to be targeted by carriers and leave your other assets alone. I also never and I mean never use bombers unless I have a carrier centric fleet myself. They will not be useful if you do not have the fighter advantage.
The third thing revolves around ship retrofitting. The best combination of tools to deal with fighter spam is Point Defence AI, Integrated Targeting Unit, Dual Flaks and Kinetic Damage small PD mounts. Give up on frag or energy damage PD weapons as they are generally better against missiles with very few exeptions.
You carriers should also get something in the way of effective PD capability but the most important thing needs to be their fighter complement. Your carriers will usually focus on covering allied ships when encounteri g a fighter disadvantage, so you have to pick sturdy and/DPS intensive fighter LPCs to both outlast the enemy fighters and help deal with them until the enemy starts running out of CR and you can push into their force, slaughtering the helpless carriers.
You can also look into using a Doom phase cruiser since it's great against fighter swarms as people before me said, but there also are very useful utility frigades like the Monitor, Tempest and Scarab that offer amazing resilience and PD capability and will gladly get swarmed by enemy fighters/bombers instead of your other, more vulnerable units.
Edit: autocorrect is killing me.