Preheat the oven to 350°F (175°C) and line a muffin tin with paper liners.
In a large bowl, whisk together flour, baking powder, baking soda, cinnamon, nutmeg, and salt.
In another bowl, beat eggs, sugars, oil, and vanilla until smooth.
Stir grated carrots into the wet mixture.
Gradually add the dry ingredients to the wet mixture, stirring until just combined. Fold in walnuts and raisins if using.
Divide the batter evenly among the muffin cups, filling each about ⅔ full.
Bake for 18-20 minutes or until a toothpick inserted in the center comes out clean.
Let the muffins cool in the pan for 5 minutes before transferring to a wire rack.
