Bring a large pot of water to a boil. Once the water boils, salt it. Bring to another boil, and add in the pasta. Cook it 3 minutes less than the package directions. .
Meanwhile, preheat the oven to 400 degrees F and line a baking sheet with parchment paper.
In a large skillet, add 2 tablespoons olive oil and heat until it’s shimmering. Add in the eggplant. Season with salt and cook until they start to soften. Add in the onion and stir together with the eggplant.
Once the onions start to soften, add in the tomato sauce and the basil.
Check the seasoning, and add a teaspoon of salt and freshly ground pepper. Stir to combine.
Prep your casserole with nonstick cooking spray or spread some olive oil around it.
Cook the pasta to very al dente (2 minutes less than the cooking time), drain and add it to large bowl. Add the sauce and toss together with the pasta. Stir in 1 cup of shredded mozzarella (I used the dairy-free mozzarella shreds, but use whatever you like).
Spoon the pasta into your prepped casserole. Sprinkle on the rest of the mozzarella cheese and a drizzle of olive oil.
Place the casserole on top of a baking sheet (this makes it so much easier to put in and remove from oven). Cover with foil and bake for 25 to 30 minutes (the sauce will be bubbling under the foil and mozzarella melting on top).
Remove foil paper for the last 10-15 minutes of baking, until lightly crusty on top. Carefully remove from oven and let rest for at least 10 minutes before serving.