On each page, a DOCTYPE must be used, and the HTML code must be valid according to the rules of the selected DOCTYPE. The choice of DOCTYPE is open.
It is especially important to:
Only validation errors are to be corrected. The warnings returned by the validator do not need to be taken into account with respect to this criteria, because they have no impact on accessibility.
Including ARIA attributes in the HTML code is a real advantage for accessibility but will invalidate the source code if the page is not produced in HTML5. If errors are returned following the inclusion of these attributes, they do not need correcting.