Agreed, that’s why I said according to the NEC is it not permitted. As I’ve seen here many times in some places that’s just how it’s done and it is acceptable even if it is not NEC compliant. From Mike Holt:
Uses permitted
So where can you use flexible cords and flexible cables? Within the scope of this article, they can be used for [400.10(A)]:(1) Pendants [receptacles—210.50(A) and boxes—314.23(H)].
(2) Wiring of luminaires [410.24(A) and 410.62(B)]. Note that you don’t use flexible cords inside ceiling areas or other hidden places, because rodents can chew through the insulation. In those locations, you must use something the little critters can’t chew through. If you still want that flexibility because you might move the light fixture, then something like Type AC Cable [Article 320] works well. In fact, you can buy “fixture whips” specifically for this purpose.
(3) Connection of portable luminaires, portable and mobile signs, or appliances [422.16].
(4) Elevator cables.
(5) Wiring of cranes and hoists.
(6) Connection of utilization equipment to facilitate frequent interchange [422.16].
(7) Prevention of the transmission of noise or vibration [422.16].
(8) Appliances where the fastening means and mechanical connections are specifically designed to permit ready removal for maintenance and repair, and the appliance is intended or identified for flexible cord connections [422.16]. Note that water heaters, furnaces, and other appliances fastened in place cannot be connected with a flexible cord unless the appliances are specifically identified to be used with a flexible cord [422.16(A)(2)].