My general rule of thumb is, unless your work environment is really causing a big negative impact on your life, time your exit so it doesn't screw someone else's life up even more.
That said, the end of a project during or after a production launch isn't necessarily a bad time for this. I left my last job the exact same way. Unless you were the only person on your team with any experience of knowledge of core components (which means it wasn't a well structured team anyway), it can work out fine.
In my case, I had done 100% of the payment/billing system (but 1/2 others knew about all the requirements from the planning stages), and probably 75% of the devops + automation (fully automated infrastructure provisioning and updates). It worked out fine.
If (US) employers really want people's departures to not mess things up, there's a simple tool then can use: contracts mandating notice periods. Of course, that would require consideration, so they'd have to provide that to employees that they are firing as well.
They've overwhelmingly chosen at-will employment, and they shouldn't be upset when their employees actually take them up on it. Two weeks is already an incredible courtesy when you can be fired at any time for any reason (as long as they're not stupid enough to say "yeah, we're firing you because you're black").
I agree that better contractual language could be valuable for business continuity on the employeer's side. But, state vs federal laws and precedent would probably make that pretty difficult to enforce in lots of locales.
That said, the end of a project during or after a production launch isn't necessarily a bad time for this. I left my last job the exact same way. Unless you were the only person on your team with any experience of knowledge of core components (which means it wasn't a well structured team anyway), it can work out fine.
In my case, I had done 100% of the payment/billing system (but 1/2 others knew about all the requirements from the planning stages), and probably 75% of the devops + automation (fully automated infrastructure provisioning and updates). It worked out fine.