Preheat the oven to 400°F.
Place 4 teaspoons of olive oil on a large cookie sheet and add the diced eggplant.
Place the tray in the oven and roast the eggplant for 20 minutes. Toss the eggplant every 7 to 10 minutes to cook on all sides.
Place a large skillet on the second shelf of the oven.
After the eggplant has been roasting for about 15 minutes place the remaining 2 teaspoons of olive oil in the skillet and add the garlic and sliced onions.
Toss well and return the pan to the oven. Toss occasionally.
Place the water in a large saucepan over high heat.
When the water boils add the pasta. Cook for about 15 minutes until the pasta is al dente.
After the eggplant has cooked for a total of 25 minutes remove from the oven.
Add the tomatoes, red pepper flakes, salt and pepper to the onions and garlic and toss well.
Set the oven to broil and cook the tomatoes and onions for another 3 to 5 minutes.
Remove 1/2 cup of the pasta water and set aside.
While the tomatoes are cooking drain the pasta.
Remove the skillet from the oven add the eggplant, pasta and basil.
Add 2 to 4 tablespoons of the pasta water and fold together gently, then serve topped with cheese.
