Preheat the oven to 400°F and line a sheet pan with parchment paper (or foil).
Cut the top off the garlic bulb, drizzle the cut side with about 1 tablespoon of the olive oil and wrap it in aluminum foil. Place it on the sheet pan and roast for 15 minutes.
While the garlic roasts, halve or quarter the cherry tomatoes and pat the salmon dry with a paper towel.
Take the pan out of the oven. Place the salmon skin side down next to the garlic and arrange the tomatoes around it. Drizzle the salmon and tomatoes with the remaining olive oil and season lightly with salt and pepper.
Return the pan to the oven and roast for 12-15 minutes. Thicker fillets may need a few extra minutes.
While the salmon roasts, cook the pasta according to the package instructions. Before draining, scoop out ½ cup of the pasta water and set it aside. Drain the pasta, return it to the pot and toss with the olive oil.
Remove the sheet pan from the oven and check the salmon. It's done when it reaches 70°C (158°F) in the thickest part, or is opaque and flakes easily with a fork. If it needs more time, return it to the oven for a few minutes. Flake the salmon into bite-sized pieces, removing the skin and any bones.
Carefully unwrap the garlic, watching for hot steam, and let it cool slightly. Squeeze the soft cloves out of their skins and mash them with a fork.
With the pot off the heat, add the reserved pasta water, mashed garlic, lemon zest and lemon juice to the pasta and toss. Add the parmesan and cheddar a little at a time, tossing well until the cheese melts into a smooth sauce. Season with salt and pepper to taste.
Gently fold in the flaked salmon and roasted tomatoes. If using spinach, stir it in now so it wilts in the warm pasta.
Top with extra parmesan and fresh basil, if using, and serve warm.