Onions are a pest repellent for Carrots
Onions and all members of the Cabbage family get along well. Onions also like Beets, Strawberries, Tomatoes, Lettuce, Summer Savory and Camomile (sparsely).
Onions do not like Peas and Beans.
Onion maggots travel from plant to plant when set in a row, so scatter your onion plants throughout the garden.