Wash and dry eggplant. Peel and slice onion and garlic cloves.
Slice eggplant into thin slices. Put eggplant slices in a strainer and sprinkle with salt on top. Let sit for about 20 minutes, until the eggplant slices develop a sweat. Preheat olive oil in a pan to medium. Remove the liquid off the eggplant slices and put each slice into the preheated pan. Do not overcrowd the slices. Pan-roast eggplant slices for a minute or two on each side, until they turn golden-brown, then remove from pan and set aside.
Heat some olive oil in the pan (you can use the same one as you used for the eggplant) and add sliced onions. Stir-fry for a couple of minutes, until the onion softens and turn golden-brown. Add garlic slices, then pour in diced tomatoes and season to taste with salt & pepper. Turn heat on low and cook for about 20 minutes, stirring occasionally.
Bring a large pot of water to a boil. When boiling, add pasta and a pinch of salt, stir well, then reduce heat to low/medium and cook according to pasta instructions. For the farfalle it's usually about 11 minutes until al-dente. Right before you drain the pasta, save a cup of pasta water.
Drain pasta and immediately add it to the sauce. Add eggplant and chopped basil leaves. Then, add a couple splashes of the saved pasta water and stir in, mixing well.
Serve topped with some grated Parmesan cheese or other aged cheese (goat / sheep).