Prepare the eggplant: Peel the eggplant if desired, then dice into small cubes. Arrange the cubes on a paper towel-lined baking sheet, sprinkle with salt, and let sit for 20 minutes. This process helps draw out excess moisture and bitterness. Rinse the cubes thoroughly to remove the salt, then pat them completely dry with paper towels. This step is crucial—if the eggplant is not dried well, it will absorb oil like a sponge when fried, resulting in greasy eggplant.
Fry the eggplant: Pour 1–1 ½ cups of frying oil into a large frying pan to create a shallow layer about ½ inch deep. Heat the oil over medium heat. Add 3–4 fresh basil leaves and 2 whole garlic cloves to the oil. When the garlic and basil start to sizzle, add the diced eggplant in a single layer, being careful not to overcrowd the pan. Fry the eggplant cubes in batches until golden brown on all sides, about 3–5 minutes per batch. Remove the fried eggplant and place it on a paper towel-lined plate to drain excess oil. If you plan to use the same pan for the sauce, clean it thoroughly after frying to remove any leftover oil.
Make the sauce: Heat 2 tablespoons of olive oil in a large saucepan or frying pan over medium heat. Add the diced onion and sauté until translucent, about 5 minutes. Add the minced garlic and cook for 1 minute, stirring to prevent burning. Stir in the 28 oz can of whole peeled tomatoes (or two 14 oz cans), breaking them up with a spoon. Let the sauce simmer for 20 minutes, stirring occasionally, until thickened. If needed, add sugar to balance the acidity. Season with salt to taste, and stir in fresh basil leaves at the end for added flavor.
Boil the pasta: Bring a large pot of salted water to a boil. Cook the paccheri or your pasta of choice according to the package instructions until al dente. Drain the pasta and set it aside.
Combine and serve: Toss the cooked pasta with the tomato sauce in a large serving bowl or pan, ensuring the pasta is evenly coated. Stir in half of the fried eggplant and half of the grated ricotta salata. Serve the pasta topped with the remaining fried eggplant, the remaining ricotta salata, and fresh basil leaves for garnish.