I've just removed my rear shock on my trek rail 9.8 2020 with thru shaft and thinking of changing the shock but there will be a hole there what have other people done as I can see into the hole and see wires is it okay just to leave it like that ?
Yes no problem leaving it, its there because the thu shaft piston actually sticks out of the shock body at full compression.
The hole will just act as a drain.
If you plug it, you will always have a little pool of water sitting there in wet weather.