I understand dual US citizens are required to enter and exit with a valid US passport, or rather 'bear' a valid US passport as the actual wording goes. However, official government websites also use the more general wording 'must enter/exit with a valid US passport' rather than simply 'bear a valid US passport on entering/exiting'. What I'm confused about is 'checking-in' to a flight leaving the US using your foreign passport, because your US passport is about to expire and the airline won't let you check-in with it, considered 'leaving' the US on a foreign passport even if you are carrying a valid US passport with you and show it to everyone who asks for it, airline, TSA? Since there is no exit immigration there is no one to show your US passport to other than the airline and TSA.
So, can you check-in to a flight to the US with your US passport, go through immigration with your US passport, and then upon leaving the US, check-in with your foreign passport (because your US passport is about to expire and the airline will not let you check-in with the about to expire US passport) but of course show your US passport to the airline as well as to any security, TSA, you encounter? Is 'checking-in' to a flight with a foreign passport leaving the US even though you are also 'bearing' a valid US passport still considered illegal? Is there anyway the airline can add your US passport information to your check-in information along with your foreign passport to clarify this with border control? I know there is no penalty but still don't see why this has to be illegal if you actually bear a valid US passport as you leave and can of course show both passports to the airline, TSA, etc. Your foreign passport would be valid for much longer for travel to Europe, your US passport just valid to leave the US.
Thanks for your help.