>Mac laptops may be eligible for an extended battery-only repair period for up to 10 years from when the product was last distributed for sale, subject to parts availability.
Probably makes sense, if you're organized enough, to get a battery swap while it's still in coverage if you'll use. My 2015 MacBook had a battery that got swollen a few years ago. Got it replaced and continue to use it as basically a browser and it's perfectly usable.
Source: https://support.apple.com/iphone/repair/battery-replacement and https://support.apple.com/mac/repair