Dealing extra damage is most common, but it can be either depending on how powerful or rare you want the item to be.
The Flame Tongue (DM p.170), a rare item, adds extra damage. It's a rare item:
While the sword is ablaze, it deals an extra 2d6 fire damage to any target it hits.
Frost Brand (p. 171) adds extra damage, and is very rare, although this is largely because of its fire resistance property:
When you hit with an attack using this magic sword, the target takes an extra 1d6 cold damage. In addition, while you hold the sword, you have resistance to fire damage.
The very rare Staff of Thunder and Lightning can also deal extra lightning damage, although its very rare status is due to its multiple other abilities.
However, a weapon which simply switches its damage type to lightning without dealing extra damage would not be too powerful, as you're just switching type (and as per Flame Tongue, it may require the use of a bonus action to activate or deactivate it). It would be suitable as an uncommon weapon.
The Sun Blade deals all damage of an energy type (radiant). It's a rare item, but that's counting its other significant abilities, including that it has +2 to attack and damage. Since a normal +2 weapon is also a rare item, and a +1 weapon is an uncommon item, we might deduce that a +1 or +0 quarterstaff with the ability to deal all energy damage is only of approximately uncommon rarity.
In short, if you want it to be an uncommon item suitable for low-level characters, you want it replace the base damage. If you want it to be a rare item suitable for higher level characters, it can increase the base damage.