Preheat oven to 375℉ and line two baking sheets with parchment paper.
In a medium bowl, whisk together flour, salt, baking powder, and baking soda. Set aside.
In the bowl of a stand mixer fitted with a paddle attachment (or in a large mixing bowl with a hand-held mixer), whip the butter on medium speed until creamy, 2-3 minutes. Add the granulated sugar and brown sugar and mix on medium speed until light and fluffy, about 2 minutes. Add the egg, vanilla extract, and sourdough discard and mix on low until smooth and combined.
Add the flour mixture and mix on low until combined. Stir in the chocolate chips or chocolate chunks.
Using a cookie scoop or a small spoon, scoop cookie dough (about 1 Tablespoon per cookie) onto the prepared baking sheets, leaving room for the cookies to spread. Bake for 12-14 minutes until lightly golden.
While the cookies are warm, sprinkle with flaky sea salt (optional). Let the cookies cool for 2-3 minutes on the baking sheet. Transfer to a cooling rack to cool fully.