If I was leaving the job Im currently at, I wouldnt tell anyone, just give my 2 weeks and hope, for their sake, its enough time for me to train my replacement.
At my old job I let them know, because I was attempting to use it as leverage to get a raise.
It takes zero effort to be a good person.