Bring a large pot of salted water to a boil. Prepare the pasta according to the package directions, cooking until al dente. Before draining the pasta, scoop out 1 cup of the starchy pasta water and set aside. Drain the pasta.
Heat 1 tablespoon of the oil in a large skillet over medium heat. Add the chard stems and cook for 1 to 2 minutes, or until they begin to soften. Add the chard leaves, garlic, salt, and several grinds of pepper, and sauté for 1 to 2 minutes, or until the leaves are wilted.
Add the pasta, the remaining 2 tablespoons olive oil, the lemon juice, caramelized onions, if using, red pepper flakes, and ½ cup of the reserved pasta water, and toss. Add the raisins and hazelnuts and toss again. If the pasta is dry, add more of the reserved pasta water. Top with the cheese, season to taste, and garnish with microgreens, if desired.