Institutes of the Christian Religion (1559) - John Calvin
Book 2 - God the Redeemer
Chapter 8 - Explanation of the Moral Law:
The 10 Commandments
Sections 17-21 - Second Commandment - no graven images
Section 17 - Spiritual worship of the invisible God
The grossest fault here is outward idolatry, but all superstitious rites are forbidden.
Worshiping images and subjecting God to our sense perception are forbidden.
Section 18 - Threatening words in the Second Commandment
The punishment for idolatry extends to the 3rd and 4th generation.
Reward for faithfulness extends "to remote posterity."
Breaking this commandment is like committing adultery against a faithful husband, according to Scripture - Eph 5:29-32; Jer 3; Hos 2:4ff; Hos 2:19-20.
Section 19 - "Who visits the iniquity of the fathers upon the children"
How can this be, when God doesn't require a son to bear his father's sin (Ezek 18:20)?
God repeats this elsewhere - Num 14:18; Ex 34:6-7; Jer 32:18.
There are temporal, earthly consequences on children for their fathers' sins - Isa 39:6-7.
But God's curse extends "upon his whole family."
Section 20 - Does not the visitation of the sins of the fathers upon the children run counter to God's justice?
Ezekiel warned Israel against thinking they would be punished for their fathers' sins no matter what they themselves did - Ezek 18:2. God curses the 3rd-4th generation by leaving them in their sin and punishing them for their own sin, not for their fathers'.
Section 21 - "And shows mercy unto thousands"
This is a general promise made to believers, that their children will also be faithful, not an absolute promise that binds Him against electing some outside of believing families, or shows Him false when covenant children fall away.