By being careful and observant. When you see the other team has a slosher, you have to be that much more careful around ledges and other areas where they can attack you with advantage, and corners where you can run into them at close range. But really, you should be doing that when you're using any long- or mid-long range weapons. Further, sloshers, tri-sloshers in particular, are much easier to spot than shooters because they're accompanied by those huge waves of ink every time they attack. Circle around and either come at them from a more advantageous direction, or choose a battle somewhere else on the map. You can also use autobombs and point sensors, and burst bombs and even sprinklers to a lesser extent, to help you scout ahead and not get caught by surprise.
The other option is to focus on close combat. If you're using a brush, a Sploosh, or most rollers, it hardly matters what mid-range weapon they're using--your job is still to sneak up on them and splat them fast. Dapple dualies can pull this off, too, though with more difficulty.