Preheat the oven to 220°C. Bring a large pot of water to a boil.
Add the gnocchi to the boiling water and cook according to the package directions; drain, reserving 1/2 cup of the cooking liquid.
Meanwhile, heat the oil in a large nonstick skillet over medium-high heat. Add the onions and 1/8 teaspoon salt and cook, stirring occasionally, until soft, about 5 minutes. Add the eggplant and cook, stirring occasionally, until the eggplant is very soft and the onions are golden brown, 10 to 12 minutes. Remove from the heat.
Add the gnocchi, reserved cooking liquid, marinara sauce and red pepper flakes to the skillet with the eggplant mixture and stir to combine.
Transfer the eggplant-gnocchi mixture to a 9-inch oval or square baking dish. Sprinkle with the provolone. Bake on the top oven rack until hot and bubbling and the cheese turns golden, about 15 minutes. Remove from the oven and let sit for 5 minutes.
Garnish with the fresh basil sprigs if using and serve.