I'm replacing a bathroom vanity light fixture. I removed the old, off-centered fixture, which was placed on top of a stud (not sure if it was to code-- the wiring was in a rectangular box on the right side of the stud, with the fixture bracket nailed directly to the stud).
The (centered) new fixture needs to be on the left side of the stud. I have figured out how to do this by attaching a shim to the left side of the stud and a fan box to the shim for the fixture wiring. I asked a previous question here that helped with this.
However, the existing Romex is too short to comfortably be threaded through a hole in the stud/shim and into the fan box on the other side. I was going to leave the old box in place, using it as a pure junction box (no fixture/switch/outlet) and running a short length of Romex from this box, through the stud/shim, to the fan box on the other side. However, I've learned it is a bad idea/against code to enclose a junction box in the wall, and I don't want a junction box cover sitting right behind my vanity light.
So, what I need to do is add maybe 6 inches to the existing Romex, without a box, so that it can be run directly into the new box on the other side of the stud. I have seen some no-box splice kit products, but it's unclear to me when these are allowed by code. Can I use one of these kits in my situation, or is there a better alternative approach?
UPDATE: I ended up moving the light fixture up a few inches so that I could get the necessary slack to route it through the stud to the other side. Here is a picture of my solution-- is there anything about this arrangement that looks off/unsafe?