Put the diced aubergine in a colander in the sink and sprinkle with salt. Leave to sit for 30 minutes.
Heat the oven to 230C
Rinse the aubergine in cold water, pat dry with kitchen towel and toss in a bowl with half the oil,then bake, well spread out, for about 15-20 minutes until caramelised, turning occasionally to make sure the pieces don’t dry out.
Meanwhile, heat the other half of the oil in a wide pan over a medium heat and add the garlic. Saute for a couple of minutes, then add the tomatoes and half the basil and bring to a simmer. Turn down the heat and cook slowly for about 20 to 30 minutes until thickened (the exact time will depend on your tomatoes).
Once the sauce is almost ready, cook the pasta in plenty of boiling salted water to your liking. Add the aubergine to the sauce and discard the basil. Drain the pasta and toss in the sauce, then divide between plates and sprinkle with the ricotta and the remaining basil leaves, roughly torn over the top. It’s best allowed to cool slightly before eating.