Not all retailers are alike when it comes to the trade war with China.

That's something to consider as President Donald Trump thinks about upping the percentage amount of pending tariffs on some $200 billion of Chinese goods imported into the U.S. to 25% from 10%.

"A full-scale trade war could dramatically impact U.S. exports and gross domestic product," wrote Greg Melich, of MoffettNathanson, in a note published on Wednesday, Aug. 1.

Overall, retail sales could be reduced between 50 and 100 basis points due to the impact on jobs and confidence, estimated the analyst. Earnings could be hit between 3% and 4%, given 30% variable margins. In addition, rising costs could hit earnings before interest and taxes by 15% before offsets.

Melich noted that while the U.S. consumer is strong, investors need to factor in the down side of protectionism before buying shares of a particular company.

Companies like CarMax, Inc.  (KMX - Get Report)  and Sherwin-Williams Co. (SHW - Get Report) are somewhat insulated, wrote Melich. At the other end of the scale are retailers like Best Buy Co. Inc. (BBY - Get Report) , Bed, Bath & Beyond Inc. (BBBY - Get Report) and Target Corp. (TGT - Get Report)  that "could see over 25% of earnings at risk if they don't move sourcing or pass through price."

However, retailers with a healthy supply-demand balance such as Home Depot Inc. (HD - Get Report) , Lowe's Companies, Inc. (LOW - Get Report) and Trucker Supply Co. (TSCO - Get Report)  are safer. Then there are the big guys, "loyalty models" Walmart Inc. (WMT - Get Report) , Inc. (AMZN - Get Report) and Costco Co. (COST - Get Report) , which combined make up about 20% of U.S. retail sales. Melich believes the three "will work to limit tariffs." Inc. is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells AMZN? Learn more now.