A professional plumber installed these long copper "detours"—
shock absorbers that trap air to silence the problem.
The cost to a home-
handyman-plumber? ...about $2. To me, this file-photo shows
very generous lengths

but it will depend on the length of your "run" to the washer.
Elsewhere, I've done the same installation with PVC
without any issues: especially in a cottage with seasonal use, either type should work just fine.