We investigate the effect of corporate sustainability on analysts' forecast accuracy. Specifically, this paper documents how financial analysts respond to environmental, social and governance factors (hereinafter ESG) in earnings forecasts. Using a novel dataset from the Bloomberg ESG ratings, we find that ESG ratings increase analysts' forecast accuracy by reducing information risks and operation risks. The results are robust to a series of robustness checks, including propensity score matching, Heckman two‐stage estimation, staggered difference‐in‐differences (DID), placebo test, firm and year fixed effects and alternative proxies. The effect of ESG ratings on analysts' forecast accuracy is more pronounced for firms audited by accounting firms with low industry expertise and for firms tracked by analysts with low industry expertise. This paper responds to the calls for more research on ESG ratings and analysts' earnings forecast accuracy and provides implications that ESG assurance can effectively improve the quality of nonfinancial information of a company. In addition, the paper is valuable for policymakers to improve the ESG disclosure system.