When packing flashlights or other battery-powered devices that might easily switch on, always turn the batteries around inside the device — or, remove one or more of the batteries completely from the device.
This way, if the item is accidentally turned on while hiking or moving about, you won’t drain the batteries.