I just recently did this on our '97 XJ. A YouTube video recommended Switch Doctor brand replacement part and it's worked well so far. They are surprisingly inexpensive. To be honest, I don't know how much of the issue was the switch or the broken ground in the door hinge, but I went ahead and replaced the switch (and fixed the ground and the check strap). I was able to buy the drivers door switch separately in June, but on Amazon and the Switch Doctor website, I'm currently only seeing the 4 pack for all of the doors. https://shorturl.at/kJRDB Pretty cheap to buy all 4 though. And there are other brands that sell just the drivers door switch. One warning though, the Mrs. discovered last weekend that Simple Green cleaner takes the paint off of the switch...
When researching this repair, I did find several people said it's the window lock button that goes out first on these switches and a few people bypassed the window lock and continued to use the same switch. This wasn't a viable option for me, so I replaced the switch, but it might be something to look into for you.