Bring a pot of salted water to a boil and add the spaghetti. Cook until tender.
Meanwhile, heat the olive oil in a large pan on medium heat. Add the onion. Let brown. Add garlic.
Add the shrimp (and optional mushrooms) to the pan. Season with the basil, crushed red pepper, salt, pepper, and parsley. Flip the shrimp once the underside is a bright pink. Cook through.
Add butter, lemon juice, white wine, and Parmesan cheese. The optional sun-dried tomatoes can be added as well. Stir occasionally for 5 minutes.
Remove the cooked spaghetti from the pot using tongs and place into the pan with the shrimp scampi mixture. Thoroughly coat the spaghetti with the scampi sauce.