A posteriori healthier dietary patterns and several nutrients have been associated with lower risks of depression in various studies; however, evidence is lacking with regard to the prospective association between adherence to nutritional recommendations (food-based and nutrient-based recommendations) and incident depression or depressive symptoms. In this study, we investigate such associations in the NutriNet Santé cohort. The study sample included 26 225 participants (aged 18–86 years) who were initially free of depressive symptoms. Adherence to nutritional recommendations was measured by four scores namely modified French Programme National Nutrition Santé-Guideline Score (mPNNS-GS), Alternative Healthy Eating Index-2010 (AHEI-2010), Probability of Adequate Nutrient Intake Dietary Score (PANDiet) and Diet Quality Index-International (DQI-I), using non-consecutive dietary record data during the first 2 years of follow-up (mean number of recording days=8, sd 2). Depressive symptoms were defined by a Center for Epidemiologic Studies Depression Scale (CES-D) score ≥17 for men and ≥23 for women. We used Cox proportional hazards models to estimate hazard ratios and 95 % CI, modelling the dietary scores as standardised continuous variables and as tertiles. Over a mean follow-up of 6 years, we identified 2166 incident cases of depressive symptoms. All dietary scores with the exception of the AHEI-2010 were significantly inversely associated with incident depressive symptoms. In the fully adjusted model, an increase of 1 sd in the mPNNS-GS, PANDiet and DQI-I was, respectively, associated with an 8 % (95 % CI 4, 13), 5 % (95 % CI 1, 9) and 9 % (95 % CI 5, 13) reduction in the risk of depressive symptoms. Overall, these findings suggest that diet in accordance with national or international guidelines could have beneficial effects with regard to mental health.