Heat 1 tablespoon of olive oil in a large skillet over medium-low heat. Add the thinly sliced onions and stir them occasionally for 25-30 minutes until they turn golden and caramelized. Set the onions aside when they’re done.
Meanwhile, cook the Farfalle pasta in salted boiling water as per the package instructions. Once it’s perfectly al dente, drain the pasta and set it aside.
Using the same skillet, add 1 tablespoon of olive oil, followed by the minced garlic and sliced mushrooms. Sauté over medium heat for about 5-7 minutes until the mushrooms are golden brown and tender.
Return the caramelized onions to the skillet with the mushrooms and garlic. Add the cooked pasta and fresh spinach leaves, tossing gently to combine. Cook until the spinach just begins to wilt.
Sprinkle the grated Parmesan cheese over the mixture and toss again. Add salt, black pepper, and red pepper flakes to taste. Stir until the cheese melts into the dish, forming a light, creamy coating.
Transfer the pasta to a serving dish and garnish with fresh basil leaves. Serve hot and enjoy every bite of this flavorful, comforting meal.