The first definition is correct.
_A sex-linked trait is a trait affected by a locus on a sex chromosome._
If you google sex-linked trait, you will find this same definition (not the exact same words) over and over again.
The definition of sex-linked trait is NOT restricted to traits that are not unrelated to primary or secondary sexual organs. Any phenotypic trait can be sex-linked as long as the causal locus is on a sexual chromosome.