How long are diapers good for?

Maybe a stupid question but how long are unused diapers good for ? I got a bunch from a friend who had her baby 3 years ago but not sure if they’re still good . They’re opened and are out of the original box. Just a bunch in a big trash bag.