Change the JS Transpiler to fail early on transpilation errors.
@@ -26,9 +26,7 @@ import com.google.javascript.jscomp.Compiler;
import com.google.javascript.jscomp.CompilerOptions;
import com.google.javascript.jscomp.CompilerOptions.Es6ModuleTranspilation;
import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
-import com.google.javascript.jscomp.DiagnosticGroup;
import com.google.javascript.jscomp.DiagnosticGroups;
-import com.google.javascript.jscomp.DiagnosticType;
import com.google.javascript.jscomp.PropertyRenamingPolicy;
import com.google.javascript.jscomp.Result;
import com.google.javascript.jscomp.SourceFile;
@@ -185,7 +183,6 @@ public final class BaseTranspiler implements Transpiler {
options.setPropertyRenaming(PropertyRenamingPolicy.OFF);
options.setWrapGoogModulesForWhitespaceOnly(false);
options.setPrettyPrint(true);
- options.setWarningLevel(ES5_WARNINGS, CheckLevel.OFF);
options.setWarningLevel(DiagnosticGroups.NON_STANDARD_JSDOC, CheckLevel.OFF);
options.setEs6ModuleTranspilation(Es6ModuleTranspilation.TO_COMMON_JS_LIKE_MODULES);
options.setModuleResolutionMode(moduleResolution);
@@ -223,9 +220,6 @@ public final class BaseTranspiler implements Transpiler {
protected SourceFile createEmptySource() {
return SourceFile.fromCode("empty.js", "");
}
-
- protected static final DiagnosticGroup ES5_WARNINGS = new DiagnosticGroup(
- DiagnosticType.error("JSC_CANNOT_CONVERT", ""));
}
/**
