When diving on vacation a scuba diver needs to be aware that residual nitrogen poses a health risk upon decompression. This applies just as much to ascending in a jet as ascending to the surface of the water. The difference in air pressure, as a plane ascends to cruising altitude, is roughly equivalent to the last 14-16 feet of ascension in water and the same risks are evident including the bends (decompression sickness) and/or an embolism. If you fly after diving you risk extremely painful gas bubbles forming in your joints and flesh, or tragically in your blood, leading to an embolism and possibly even death.
A good conservative rule is to ensure that you have no residual nitrogen in your body before flying. Following the NAUI dive tables, you should be in letter group A or less (which can take over 9 hours). A safe suggestion is to pass a full 24 hours after your last scuba dive before flying.
Dive computers, which track nitrogen levels, have a “time-to-fly” indicator, which tells a scuba diver how long they need to wait before boarding a plane. Plan your last dive sensibly, so that you aren’t bringing nitrogen along for a painful and possibly fatal return trip.