Preheat your oven to 400°F (200°C).
In an oven-safe baking dish, combine the cherry tomatoes, feta cheese, minced garlic, olive oil, salt, pepper, and red pepper flakes if using. Toss gently to coat everything evenly.
Bake in the preheated oven for 25 minutes, or until the tomatoes are blistered and the feta cheese is soft and golden on top.
While the feta and tomatoes are baking, cook the pasta according to package instructions until al dente. Drain the pasta using a colander.
Once the feta and tomatoes are done baking, remove the dish from the oven and use a fork to mash the feta and mix it with the roasted tomatoes until creamy.
Add the cooked pasta to the baking dish and toss everything together until well combined. Mix in fresh basil leaves for added flavor.
Taste and adjust seasoning if necessary. Serve hot, garnishing with grated parmesan cheese if desired.