My salt is bought either in large plastic containers, small plastic containers with a spout, or plastic bags (for refilling the other two). I don't know how air-tight it all is but I've never had a problem.
Sugar comes in paper bags and likewise lasts more or less forever.
I think it's important stuff not to run out of, purely as a flavour enhancer. There's a variant of the Cinderella story in which the father asks his 3 daughters how much they love him.
"I love you more than gold and silver" says the first.
"I love you more than diamonds and rubies" says the second.
"I love you more than salt" says Cinderella.
Hence Cinderella falls out of favour because the father thinks salt is without value, and he doesn't intercede when poor Cinders gets mistreated by the other two. He was, needless to say, completely wrong. As another wise man is reputed to remark, "if salt loses its taste, how will it be made salty again?" (Matthew 5:13).
_________________________
Quality is addictive.