public void handle(CompilerOptions compilerOptions) { compilerOptions.setCheckEventfulObjectDisposalPolicy(AGGRESSIVE); compilerOptions.assumeStrictThis(); compilerOptions.setCheckMissingReturn(CheckLevel.ERROR); compilerOptions.setAggressiveVarCheck(CheckLevel.ERROR); compilerOptions.setCheckDeterminism(true); compilerOptions.setBrokenClosureRequiresLevel(CheckLevel.ERROR); compilerOptions.setCheckTypes(true); compilerOptions.setInferConst(true); CompilationLevel.ADVANCED_OPTIMIZATIONS.setOptionsForCompilationLevel(compilerOptions); CompilationLevel.ADVANCED_OPTIMIZATIONS.setTypeBasedOptimizationOptions(compilerOptions); }
@VisibleForTesting static CompilerOptions getCompilerOptions() { CompilerOptions options = new CompilerOptions(); DependencyOptions deps = new DependencyOptions(); deps.setDependencySorting(true); options.setDependencyOptions(deps); options.setIdeMode(true); options.setCheckSuspiciousCode(true); options.setCheckSymbols(true); options.setCheckTypes(true); options.setClosurePass(true); options.setPreserveGoogRequires(true); options.setWarningLevel(DiagnosticGroups.MISSING_REQUIRE, CheckLevel.ERROR); return options; }
@Override void apply(CompilerOptions options, boolean value) { options.setCheckTypes(value); }