Catalysis of the reaction: a 3-hydroxy-fatty acyl-CoA = a enoyl-CoA + H2O. This reaction usually occurs in the reverse direction, leading to the reduction of the double bound of enoyl-CoA in position 2 or 3. Specific reactions catalyzed include: a 4-saturated-(3S)-3-hydroxyacyl-CoA = a (3E)-enoyl-CoA + H2O and a (3S)-3-hydroxyacyl-CoA = a (2E)-enoyl-CoA + H2O.
3-hydroxyacyl-CoA dehydratase