I buy whole stemmed mushrooms - cremini and white button varieties.
the supplier used to put the pack date on the carton, and one could count on 10-13 days past that before they would get spotty.
now the supplier puts a sell by date on the carton, and I look for a date at least 7 days out from day of purchase.
proper storage also helps - I have a ventilated container, I put a folded paper towel on the bottom so they don't sit in moisture.
people don't get sick from store mushrooms, people get sick/die from the self-picker/forager who does not know what he's doing.
sliced mushrooms go bad much more rapidly - I never buy them.
ditto on the avocados . . .