In a medium bowl, whisk together the flour, baking powder, baking soda and salt. Set aside.
In the bowl of a stand mixer fitted with a paddle attachment (or with a large bowl and handheld electric mixer) beat the butter, brown sugar and granulated sugar together on high speed until light and fluffy, about 4 minutes.
Beat in the egg, followed by the sourdough discard and vanilla extract. Scrape down the sides of the bowl to make sure everything is evenly mixed.
Reduce the speed and add in the flour mixture, stopping when just combined. Lastly stir in the chopped chocolate.
Line a small tray with parchment paper and scoop heaped tablespoons of dough on it. Cover the tray with plastic wrap and refrigerate for a minimum of 3 hours, or overnight.
When ready to bake, preheat the oven to 375° (190°C) and line a baking sheet with parchment paper.
Place the dough 2-inches (5 cm) apart on the prepared tray and flatten slightly.
Bake for about 12 minutes, until the edges are starting to brown.
Remove from the oven and let firm on the tray for 5 minutes before transferring to a wire rack to cool completely. Repeat baking the remaining dough if you wish.
Store cooled cookies in an airtight container at room temperature for up to 2 days.