A most general density-matrix formalism is presented to investigate linear polarization of characteristic lines following electron-impact excitation of atoms or ions with arbitrary nuclear spin, which can account for depolarization of energy levels and multipole mixing of radiation fields. It is then applied to the linear polarization of the
K
α
1
line radiated from heliumlike ions with nuclear spin
I
=
1
/
2
. As an example, detailed calculations are performed for
81
207
Tl79+ ions using the multi-configurational Dirac-Fock method and relativistic distorted-wave theory. It is found that the effect of the hyperfine interaction on the linear polarization depends dominantly on impact electron energy. For low impact energies close to the excitation threshold, the hyperfine interaction results in an enhancement of the linear polarization, especially for those photons emitted perpendicularly to the impact electron beam. In contrast, such a hyperfine-induced effect diminishes quickly with increasing impact energy and vanishes at medium and high energies, which is very different from the results for the case of radiative electron capture (Surzhykov et al 2013 Phys. Rev. A 87 052507). The present study is experimentally accessible at both electron-beam ion traps and ion storage rings and, thus, accurate
K
α
1
polarization measurements at low energies can be utilized to probe the hyperfine interaction in highly charged few-electron ions.