Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
gulp.task('amphtml:validate', () => {
return gulp.src('../../testdata/feature_tests/*.html')
// Valide the input and attach the validation result to the "amp" property
// of the file object.
.pipe(gulpAmpHtmlValidator.validate())
// Print the validation results to the console.
.pipe(gulpAmpHtmlValidator.format())
// Exit the process with error code (1) if an AMP validation error
// occurred.
.pipe(gulpAmpHtmlValidator.failAfterError());
});
return () => {
return gulp.src(page)
// Validate the input and attach the validation result to the "amp" property
// of the file object.
.pipe(gulpAmpValidator.validate())
// Print the validation results to the console.
.pipe(gulpAmpValidator.format())
// Exit the process with error code (1) if an AMP validation error
// occurred.
.pipe(gulpAmpValidator.failAfterError());
// .pipe(gulpAmpValidator.failAfterWarningOrError());
};
};
gulp.task('validate', function () {
return gulp.src('dist/**/*.html')
.pipe(gulpAmpValidator.validate())
.pipe(gulpAmpValidator.format())
.pipe(gulpAmpValidator.failAfterError());
});