"If you feel driven to eat for emotional reasons, you don't have an eating problem. Nope. You have a caretaking problem." – Linda Bacon, PhD, Health at Every Size
The same is true if you avoid eating for emotional reasons. The problem isn't the food. If you assume that it is though, your focus remains on "fixing" the food, which is like chasing your tail.
By acknowledging that the problem is in your caretaking you are able to address it in a productive way. If you find that you're eating because you're lonely, then caring for yourself means seeking connection (and I don't mean connection with food). If you find that you're eating because you're stressed, then identifying the source of your stress and finding other ways to cope will bring you more peace than any food ever will.
So, every time you are driven to eat for reasons other than hunger, ask yourself what you are feeling and how you can care for yourself without using food.