Question about hard-wiring hanging flourescent light

I'm selling my house. Basement has a pool table which will stay with the house. I installed a shop light (2x4' fluorescent tubes) over the table, suspended by chains. I hard wired the lamp, removing the original line cord & running the 14/2 into the lamp housing using one of those metal fittings that clamps the cable (removed the original strain relief, enlarged the hole & screwed in the fitting). Lamp is controlled by a nearby wall switch. After looking at the damned thing hanging by the chains, it occurs to me that, since the light can swing a bit if someone pushes on it, it may not be code to run the 14/2 right into the lamp; maybe I should have wired an outlet box on the ceiling (open joists, actually) next to where the lamp will hang and then plug the original line cord into this, as you see sometimes with garage door openers. If it weren't for the fact that I'm selling the house (ie, if I were staying here) & don't want some inspector to have a conniption over the wire, I'd just leave it. Works fine, electrically fine, other than the possible (though unlikely) problem of movement of non-stranded wire. Distance from the joist where the 14/2 is stapled to the lamp is about 14". Anyone know if the direct wired setup is a code problem, and if so should I just replace the line cord then wire a box to plug the thing into?
Thanks,
David
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I would go with the cord and outlet. Pray the home infector is not aware of what a "strain relief" is.
As long as the cord is not relying on the plug to stay in place. Anchor and a clear ty-wrap you should be good to go.
A ceiling cover plate with the romex connector in the center and one on the fixture and some SJ cord you good to go.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

HomeOwnersHub.com is a website for homeowners and building and maintenance pros. It is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.