I assume by "main area" you mean the motor/inverter and associated bits.
Just my opinion here, but even with the underbody covers on a Leaf there is plenty of moisture, dirt, and grime getting to things under the hood when you drive on wet roads. If Nissan didn't plan for this in terms of sealing electronic components under the hood it would be a known issue, both on this forum and in elsewhere.
When we first got our very filthy 2014 Leaf in 2021 (possibly never washed or vacuumed, but that made it cheap) I pressure washed the underside of the hood, the inner fender areas, the firewall and cowl, and the front radiator support area without really worrying about electronics. Note that the Leaf was not "on," but even if it had been I doubt there would have been any issues. I did not spray pressurized water directly on the motor/inverter, but I did spray soap and then rinse it with water at typical garden hose pressure.
Maybe that was naive, but I've been doing the same on ICE cars for years and never had a problem. Cars operate in adverse conditions every day and are engineered (some better, some worse) for those conditions.
Is there some aspect of peppermint oil that would make it especially corrosive? If not, I wouldn't worry about it.
As for the general issue of keeping critters out of your car, that is the eternal battle. I'm in central MA and rodents are a constant problem in both our Leaf and Honda Fit which are parked inside an older garage that is clearly not rodent proof. It got so bad with the Fit that each time we prepared to drive it I would pull the old sacrificial cabin air filter (well soiled with scat and urine) and replace it with a clean filter for the trip. When we got home I would shake out the sacrificial filter and put it back in, thereby preserving the good filter for our next trip. (Note: we mostly use the Fit for long trips and the Leaf for day-to-day local driving, so this wasn't as bad as it might seem.) The Leaf has had similar issues, including acorns somehow finding their way into the blower motor when we were away for about a week, prompting my wife to tell me the car sounded like a machine gun.
On the Fit I was able to, with minor lacerations and major cursing, cover the cabin air intake under the cowl with 1/4 inch galvanized hardware cloth. Since that time no more rodents on the cabin air filter. I'm planning to attempt the same procedure with the Leaf, as well as with the engine air intake for the Fit. I have no good ideas for keeping rodents out of the engine bay area in general. I have been lucky so far (knock on wood) that they've never damaged wiring in the Fit or Leaf.