A slew of major retailers have struggled with sluggish sales this year, but Costco Wholesale (NASDAQ:COST) has continued to post solid comparable-store sales gains month after month. That streak continued in July.

That said, there has been a noticeable deceleration in Costco's comp sales growth over the past six months or so. And while most retailers would be delighted to achieve the level of growth the discount warehouse giant has been reporting, their shares don't trade for 34 times earnings, as Costco stock does. With sales growth cooling off, Costco stock looks too pricey to be a prudent investment right now.

Another month of mid-single-digit comp sales growth

Costco posted a 5.6% comp sales gain in July. Adjusted for currency fluctuations, changes in gasoline prices, and new revenue recognition rules, comp sales increased 5.1%, right in line with the company's performance during the month of June.

The entrance to a Costco warehouse

Costco posted another mid-single-digit comp sales gain last month. Image source: Costco Wholesale.

As has been the case for most of the past several months, Costco reported relatively consistent comp sales growth in all merchandise categories and all regions of the world. Higher customer traffic also continues to be the company's main sales growth driver, with larger transaction sizes having a lesser impact.

Sales growth had been stronger previously

Costco's sales performance for the past few months has been quite solid, but the company had been delivering even stronger gains not too long ago. In fiscal 2018 -- the period that ended on Sept. 2, 2018 -- Costco recorded a 6.8% adjusted comp sales increase. Through the first five months of fiscal 2019, comp sales jumped 7.5% year over year.

By contrast, adjusted comp sales growth hasn't reached the 6% mark in any of the six months since then. With gains averaging around 5% over that period, Costco's fiscal year-to-date adjusted comp sales increase now stands at 6.1%.

Investors haven't been fazed by this moderating sales growth rate. Costco shares hit a new all-time high last month. Notwithstanding a slight pullback in recent weeks, the stock has surged 75% over the past two years.

COST Chart

Costco wholesale stock performance. Data by YCharts.

Slower sales growth -- even if it's very good by comparison to other retailers -- will put a damper on Costco's earnings growth. Strong sales growth has been critical to Costco's ability to offset high wage inflation, particularly in the U.S.

Additionally, Costco has benefited from three major earnings drivers over the past three years: the switch to a new, more-lucrative credit card deal with Citigroup, U.S. tax reform, and a mid-2017 membership fee increase in the U.S. and Canada. It won't benefit from equivalent profit tailwinds over the next several years, adding to the likelihood of lower earnings growth for the foreseeable future.

Costco stock is just too expensive

Costco Wholesale reported a profit of $5.33 per share in its 2016 fiscal year. For comparison, analysts expect adjusted earnings per share to total $8.07 for fiscal 2019, which ends in a few weeks. That would represent a 51% increase relative to fiscal 2016 and a 15% compound annual EPS growth rate over the past three years.

By contrast, analysts currently estimate that sales will grow about 7% (including the impact of new warehouse openings) and EPS will rise 6% in the upcoming fiscal year. Those seem like fairly realistic expectations in light of Costco's recent business trends.

Based on these forecasts, Costco stock trades for 32 times next year's earnings. That would be perfectly reasonable if the company were likely to deliver high single-digit sales growth and double-digit earnings growth, as has been the case in recent years. However, Costco's current level of growth can't support such a lofty earnings multiple.

Costco is a well-run company with a deep moat. But until the stock retreats to a more reasonable valuation or sales growth accelerates, investors should probably stay on the sidelines.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.