What happened

Stocks are flying high on Wednesday on investor hopes that inflation is moderating, lessening the risk the Federal Reserve will have to act aggressively and end up pushing the economy into a recession. Airlines, a sector that typically underperforms broader markets during a recession, are doing better than most, with shares of  American Airlines Group (AAL -2.18%), JetBlue Airways (JBLU -3.12%), and United Airlines Holdings (UAL -2.52%) all up as much as 5% in afternoon trading.

So what

Airline investors have flown through a lot of turbulence over the past few years. The pandemic wiped out travel demand, and airline revenue with it, and the hoped-for rally in 2022 as vacation travel bounced back has been partially stymied by higher fuel and labor costs.

The industry is slowly recovering, but it doesn't need any further headwinds. That's why the stocks have been under pressure as fears of a potential recession grew. In the event of a downturn, budget-conscious consumers and businesses are more likely to cut travel spending than they are more essential items.

On Wednesday, the Bureau of Labor Statistics said inflation held steady in July compared to June. Consumer prices were still up 8.5% year over year, meaning that inflation remains a threat, but the year-over-year jump was not as severe as economists had expected.

The data keeps the so-called "Goldilocks landing," where the Fed is able to slow the economy enough to tame inflation without driving it into a recession, alive. That would be the ideal outcome for airlines, and the stocks are jumping as a result.

American has the highest debt burden among major carriers, and could least afford a recession. JetBlue, meanwhile, has a deal pending to acquire Spirit Airlines. The deal is motivated by growth, and harder to make work if travel demand subsides for an extended period. United's network works best when Silicon Valley companies and international travel are strong, and the stock tends to outperform when things are going well.

Now what

Investors are rightly celebrating that macro conditions do not appear to be getting worse. But they shouldn't get ahead of themselves in celebrating a recovery.

The July inflation number in part reflects an easing of energy prices. Given that fuel represents more than 30% of an airline's total operating expense, lower oil prices will be a big help, but there is nothing in the numbers to suggest that the labor crunch that has hit the industry this summer will ease any time soon.

The economic uncertainty isn't going to disappear with one inflation report, and the pilot shortage will likely continue into 2023 for many airlines. If businesses take a cautious approach to hiring and travel in the months to come, it could be the second half of the decade before corporate travel returns to pre-pandemic levels.

Even with Tuesday's gains, these stocks are all at least 27% below their 52-week highs. Until we have more clarity about the long-range direction of the economy, and how airlines are dealing with the challenges they face, there are likely limits to how high airline stocks can fly.