"I only like salty food. I don't like sweet food."
"Salty" is used by non-native English speakers more widely than by native speakers. Native English speakers only use it for foods that have too much salt or at least where salt is a major part of the flavour, like snacks you eat at a bar. Non native speakers can use it for pretty much any food that is not sweet. For that meaning there's a more accurate word that native speakers use, "savoury". We use that for non-sweet, for spicy, and also for salty food that's not too salty. Like mushrooms, meat, pizza, cheese, etc.
So it's extremely rare that somebody "only likes salty food" but quite common that someone only likes savoury food.
Isn't this more like 'I only eat salty food'? There are other characters you could use for 'food'.