What is the projected range of the JWST to be able to detect exoplanet atmospheres? Yesterday the K2 mission detected transit events of objects passing in front of a number of M dwarfs which could turn out to be rocky planets. If some of these planets host atmospheres, could the JWST detect IR absorption lines from molecules in these atmospheres?

What would be the expected limiting distance for these stars to allow for such measurements by the JWST?
According to this article, the TRAPPIST-1 system is supposed to be studied by JWST with the potential to detect atmospheres' composition in infrared band. So at last 40 ly (approx. 12 pc) should work. Somewhere else I read there is an assumption to study earth-like exoplanetary atmospheres at distance of 10-20 pc. But it might be better to see it from different angle: the real limit is due to the produced light energy/intensity, not the distance itself. For example, see an article on exoplanet transit spectroscopy.