As long as it is outside the footprint you are OK code-wise.

Doesn't do much to stop you from plugging in the TV and setting it on the tub ledge tho. I know that hard and fast distances might be hard to achieve in a small bath but there should be a better way.