Cream the butter and sugar in a stand mixer fitted with a paddle attachment.
Add the dry ingredients and mix until combined.
Scrape down the sides of the bowl, then add all of the remaining ingredients (except for the chocolate chips). Mix on low, just until the ingredients are evenly incorporated.
Scrape down the sides of the bowl, then add the wet ingredients (eggs, sourdough discard, and vanilla extract). Add the dry ingredients and mix on low, just until the flour evenly absorbed. Sprinkle over the dark chocolate chips and turn the mixer on for a few seconds to distribute throughout the dough.
To form the cookies, use a 1/4 cup scoop to portion the dough onto two parchment lined sheet trays. Each tray should hold 12 cookies. Sprinkle a little flaky salt over each ball of dough. Chill for at least one hour before baking.
While the cookies are in the refrigerator, pre-heat the oven to 375ºF. Bake the cookies for 20 minutes, rotating the trays half way through the bake. Enjoy the cookies warm from the oven or at room temperature!