Bring a large pot of water to a roaring boil. Add salt. Cook pasta al dente, according to instructions on package. Drain.
In a large saute pan, heat olive oil, onions, and garlic. Cook for 1-2 minutes, or until fragrant. Stir frequently to prevent garlic from burning.
Add eggplant and cook for 15 minutes, stirring occasionally.
Add the tomatoes to the saute pan and stir. Cook for 2-3 minutes, stirring occasionally.
Add tomato paste, basil, oregano, red pepper flakes, and vinegar to saute pan, stirring occasionally. Cook for 1 minute.
Add the drained pasta to the saute pan and mix well. Add some of the reserved pasta water if the dish appears dry. You may not need the entire cup. Stir.
Plate pasta and garnish with fresh basil and cheese. Serve hot.