Electron affinity decreases in a group from top to bottom due to increase in size, so the expected order of electron affinity for halogens is F>Cl>Br>I
However, it is not so. The electron affinity of elements of III period is higher than that of II period because elements of II period have a small size and greater electron density so the incoming electrons suffer a repulsive force. Thus the order of electron affinity is Cl>F>Br>I.