This is what the National Fire Alarm Code (NFPA 72) Handbook (section 11.8.3.5) says about this:
(5) Smoke alarms and smoke detectors shall not be installed within a 914-mm (36-in.) horizontal path from a door to a kitchen or a bathroom containing a shower or tub.
Smoke detectors and smoke alarms must be properly located to avoid nuisance alarms. Dust, grease, dirt, insects, and other contaminants can make smoke alarms and smoke detectors more sensitive to stimuli such as cooking vapors and bathroom moisture. Higher sensitivities frequently cause nuisance alarms and subsequent disconnection of the device, leaving the occupants without adequate protection. Smoke alarms and detectors that produce nuisance alarms should be relocated away from areas that produce excessive moisture, cooking vapors, or dust. Areas of potential concern are kitchens, bathrooms, garages, and basements with dirt floors or moisture problems.........