Background: More is to be explored between dietary patterns and sleep quality in the Chinese adult population. Methods: A cross-sectional study including 7987 Shanghai suburban adults aged 20–74 years was conducted. Dietary information was obtained using a validated food frequency questionnaire. Adherence to a priori dietary patterns, such as the Chinese Healthy Eating Index (CHEI), Dietary Approaches to Stop Hypertension (DASH) diet and Mediterranean diet (MD), was assessed. Sleep quality was assessed from self-reported responses to the Pittsburgh Sleep Quality Index (PSQI) questionnaire. Logistic regression models adjusting for confounders were employed to examine the associations. Results: The overall prevalence of poor sleep (PSQI score ≥ 5) was 28.46%. Factor analysis demonstrated four a posteriori dietary patterns. Participants with a higher CHEI (ORQ4 vs. Q1: 0.81, 95% CI: 0.70–0.95), DASH (ORQ4 vs. Q1: 0.70, 95% CI: 0.60–0.82) or MD (ORQ4 vs. Q1: 0.75, 95% CI: 0.64–0.87) had a lower poor sleep prevalence, while participants with a higher “Beverages” score had a higher poor sleep prevalence (ORQ4 vs. Q1: 1.18, 95% CI: 1.02–1.27). Conclusions: In Shanghai suburban adults, healthier dietary patterns and lower consumption of beverages were associated with better sleep quality.