If Salazar's mission in Pirates of the Caribbean: Dead Men Tell No Tales was only to eradicate the pirates, then why didn't he do anything when his ship's left side faced Jack's ship? That's so much cannons in that side.
I mean he got plenty cannons and plenty of advisors, his ship was more like a floating Spanish fortress, and the crew had high morale.