Investing in the US stock market is haram since the majority of the companies were built on Riba.

Laymen should not issue fatwas as you have here with "investing in the US stock market is haram". You've provided no scholarly support for this opinion either. Saying it's haram to invest in companies involved in riba is not the same as labeling the US stock market haram.

There are riba-free companies on the market.

https://www.islamicfinanceguru.com/articles/investment/the-top-5-debt-free-halal-stocks-on-the-nyse

Furthermore, anyone seeing this post should get the full picture regarding the permissibility of investing in stocks. There are plenty of scholars who have concluded that it's permissible to buy stocks given certain criteria to ensure Sharia-compliance (such as Mufti Taqi Usmani and Mufti Faraz Adam).

https://www.islamicfinanceguru.com/articles/investment/how-to-screen-for-halal-sharia-compliant-shares

https://amanahadvisors.com/making-sense-of-the-30-rule-in-islamic-finance/

Also, I personally would caution taking any financial rulings from IslamQA. I have read their opinions on derivatives and forex and it's clear they do not really understand these things. I am not doubting their Islamic knowledge but how can they properly apply it when they don't understand the financial concepts?

/r/IslamicFinance Thread