function validationAutoFix(validationErrors) {
    // Currently only autofixes bitwidths
    let fixedErrors = 0;
    // Return if no errors
    if (validationErrors.ok) return fixedErrors;

    const bitwidthErrors = validationErrors.invalids.filter((vError) => vError.type === VALIDATION_ERRORS.WRONGBITWIDTH);

    bitwidthErrors.forEach((bwError) => {
        const { element, expectedBitWidth } = bwError.extraInfo;
        element.newBitWidth(expectedBitWidth);
        fixedErrors++;
    });

    return fixedErrors;
}
Autofix whatever is possible in validation errors.
returns number of autofixed errors
@param {Object} validationErrors - Object with errors returned by validate()