Covalent organic frameworks (COFs) offer ordered π structures that are useful for developing light-emitting materials. However, most COFs are weak in luminescence. Here we report the conversion of less emissive COFs into light-emitting materials via a pinpoint surgery on the pore walls. Deprotonation of the N-H bond to form an anionic nitrogen species in the hydrazone linkage can eliminate the nitrogen-related fluorescence quenching pathway. The resulting COF enhances the fluorescence in a linear proportion to the progress of deprotonation, achieving a 3.8-fold improved emission. This pinpoint N-H cleavage on the pore walls can be driven only by the fluoride anion while other halogen anions, including chloride, bromide, and iodide, remain inactive, enabling the selective fluorescence switch-on sensing of the fluoride anion at a ppb level.