Here's the code wording. The lamp needs to be completely enclosed, whatever that means.
410.16 Luminaires in Clothes Closets.
(A) Luminaire Types Permitted. Listed luminaires of the following types shall be permitted to be installed in a closet:
(1) A surface-mounted or recessed incandescent luminaire with a completely enclosed lamp
(2) A surface-mounted or recessed fluorescent luminaire
(3) Surface-mounted fluorescent or LED luminaires identified as suitable for installation within the storage area
(B) Luminaire Types Not Permitted. Incandescent luminaires with open or partially enclosed lamps and pendant luminaires or lampholders shall not be permitted.