Punctuation
American style guides (Chicago, APA) put a full stop after each letter and a comma after: “e.g., apples”. Many British guides drop the comma, and some (such as the Guardian’s) drop the stops too: “eg apples”. Don’t add “etc.” after an e.g. list; “e.g.” already says the list is incomplete.
Catch it automatically
The grammar checker flags common mix-ups like this one by looking at the words around them, and the sentence checker can explain any sentence you’re unsure about.