What is the Virginia code regarding gas water heater connections?
Virginia code regarding materials for water heater hookups doesn't get too specific but does to say to make sure you're in accordance with the water heater's manual.

I'm not sure what model you have but the instructions for a current Whirlpool electric water say CPVC is fine (see page 6, item 3). It also recommends compression fittings if you don't want to solder, but doesn't specifically prohibit Sharkbites.

Also the code is OK with CPVC. I took a look for something specifit to within 'X' distance of a water heater and didn't see anything. Here's the link for the code if you'd like to take a look yourself.

Expansions tanks are required if you have a Pressure reducing value (PRV) or backflow preventer. If you do not then there's no need for an expansion tank.

Local codes may superceed state codes, so check what your county &amp; town say. If you call the inspector's office and set up a time to call and speak with an inspector, they should be happy to answer your questions. And if this was installed without a permit they'll be interested to hear about that as well probably. (And if it was installed with a permit it should have been inspected, which would mean it's fine).