how to avoid harmonic on intrrupt for proximity sensor in NodeMcu
You will really need to research if the pulse output from the sensor is actually generating spurious interrupts to the MCU. This could be in the form of noise, bad circuit design or upset from the environment. This type of study usually entails the use of an oscilloscope to evaluate signal integrity and make sure signalling is within specifications for proper operation. 

A second instrument that may prove to be valuable in the research is a logic analyzer device that could help you correlate activity in your MCU software against signal pulses seen on the hardware interface.