This is in Shattered Pixel Dungeon. Went into the shop after getting enough money to buy the Ankh and was followed by a bat. Without paying attention I fought the bat and my shocking sword's ability went off twice, bouncing into the shopkeep and making him leave. Maybe I'm just a bit salty and it's my fault for not paying attention to the first hit/warning from the shopkeep, but I don't think the shocking sword enchantment should threaten the shopkeep like that.
Seriously though, never fight anything in the shop, just kite enemies, get away, finish them outside.
It's fine if you get a few blows from a faster enemy
Careful with scrolls that affect all visible creatures too.
Definitely punishing. Just never fight in the shop keep room as a rule. I haven't lost the shop keep in more than probably 100 of my last run attempts, with maybe the exception when I had the thieves armband
He just wants safe working conditions. Gotta respect that. No fighting in the shop. Just another part of the game. Learn the pattern and keep moving forward.