This is sadly, one of those matters of "convention" that chemistry is so plagued by.
For most neutral atoms, the magnitude of $\Delta H$ for the following reaction is negative (i.e. energy is released upon the addition of an electron).
$$\ce{A (g) + e- (g) -> A- (g)} \tag{1}$$
The value of $\Delta U$ for the reaction is, in some places, called the "electron affinity". In other places, $\Delta H$ for the reaction is called the "electron-gain enthalpy".[1]
The convention that is more common (as far as I know) is to define the electron affinity as the negative of $\Delta U$ for the above reaction. This means that electron affinities, as defined in this way, are usually positive. This convention is adopted by most major introductory inorganic chemistry textbooks and is also what I learnt in undergrad. However, if you are supposed to use a different convention for your examinations etc., then do so.
The moral of the story is: in every book you read, always double check what is the sign convention. It can and will differ from book to book.
[1] To make things even more confusing, $\Delta H$ (the change in enthalpy) and $\Delta U$ (the change in internal energy) is used in different contexts. The difference between the two is given by
$$\Delta H(T) = \Delta U(T) + \frac{5}{2}RT$$
which may be understood using Kirchhoff's law since $\Delta H(0) = \Delta U$. (Alternatively there is a derivation in Housecroft & Sharpe's Inorganic Chemistry 4th ed., p 25.) Since $5RT/2$ is only roughly $6~\mathrm{kJ~mol^{-1}}$ at $298~\mathrm{K}$, this contribution is usually negligible compared to the usual magnitudes of electron affinities.