Donald Trump's sweeping 10 per cent tariff on nearly all imports has been found to be illegal by a US court.