If you have a field, say phone number and you make it optional it should still validate the field if you type some value. If no value then ignore it when submitting.
Examples:
<input class="optional validate-phone-number" value="123">
That would be invalid.
<input class="optional validate-phone-number" value="1234567890">
That would be valid.
<input class="optional validate-phone-number" value="">
That would be valid.