Unlike the Jap carriers that became horrid infernos, Yorktown fared much better due in large part to:
1. Better USN damage control.
2. A fuels division petty officer aboard Yorktown floated the idea of, before battle, replacing the aviation fuel from all lines with inert CO2.
It is why the non-burning Yorktown was attacked a second time.
The matter is discussed at some length in “Shattered Sword”. “Better USN damage control” doesn’t quite cover it. In IJN doctrine, damage control was a specialty only. The damage control guys got good training, but there were relatively few of them. The rest of the sailors got nothing. In USN doctrine, there were damage control specialists, but damage control was considered EVERYBODY’S business, and everybody got trained.
That’s not to discount the value of purging the fuel lines.