Cook the pasta: bring a large pot of water to a boil, salt it well, and add the pasta. Cook about 2 minutes less than the package directions, until very al dente, it will finish cooking in the oven. Drain and set aside.
Heat the oven: preheat to 400°F.
Cook the eggplant: in a large skillet, heat 2 tablespoons of the olive oil until shimmering. Add the eggplant, season with salt, and cook until it starts to soften. Add the onion and cook until softened and translucent.
Add the tomato sauce: stir in the tomatoes and basil. Season with the remaining salt and pepper and stir to combine. Let simmer while you finish the pasta.
Prep the baking dish with nonstick cooking spray or a little olive oil.
Combine the pasta and sauce in a large bowl, then stir in 1 cup of the mozzarella.
Spoon the pasta into the prepared casserole dish. Sprinkle with the remaining mozzarella and drizzle with the last of the olive oil.
Set the casserole on a baking sheet (makes it much easier to move in and out of the oven). Cover with foil and bake 25 to 30 minutes, until bubbling and the mozzarella is melting.
Remove the foil for the last 10-15 minutes, until lightly crusty on top. Let rest at least 10 minutes before serving.