The code actually does have some specific provisions for lighting fixtures (or Luminaires).

There are a few thing to also consider.

A cord that is factory installed is considered part of the appliance, and the NEC generally does not apply to the parts of an appliance.

That said, 'lighting whips' are addressed by some code sections. 402.5 suggests that even #18 can be acceptable.

There is likewise a provision in the NEC that alows lighting circuits to be as large as 50 amps. I really doubt there are any fixtures out there with #6 wires passing through them; the final six foot run is commonly a conductor smaller than the branch circuit conductors.