This is stated outright in 1 John 2:21 "I have not written unto you because ye know not the truth, but because ye know it, and that no lie is of the truth."
John starts the letter with assurances that he is an eye witness to the life of Jesus Christ, which made clear that He was God's Word, made flesh (1 John 1:1 "That which was from the beginning, which we have heard, which we have seen with our eyes, which we have looked upon, and our hands have handled, of the Word of life;").
John also gives the bad news of sin, and the good news of salvation (1 John 1:8-10, 1 John 2:1-2).
Now, we must careful not to confuse holding to the Ten Commandments with our salvation as Christians. When John talks of "keep[ing] the commandments" (1 John 2:3), he is not talking about the Law of Moses. This is spelled out in 1 John 3:23 "And this is his commandment, That we should believe on the name of his Son Jesus Christ, and love one another, as he gave us commandment."
I'll close with 1 John 5:13:
"These things have I written unto you that believe on the name of the Son of God; that ye may know that ye have eternal life, and that ye may believe on the name of the Son of God."