Skip to content

Commit

Permalink
use ES6 library when building tslint rules (microsoft#14474)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladima authored Mar 5, 2017
1 parent 19e88ac commit b152034
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 9 additions & 3 deletions Jakefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,14 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
if (opts.stripInternal) {
options += " --stripInternal";
}

options += " --target es5 --lib es5,scripthost --noUnusedLocals --noUnusedParameters";
options += " --target es5";
if (opts.lib) {
options += " --lib " + opts.lib
}
else {
options += " --lib es5,scripthost"
}
options += " --noUnusedLocals --noUnusedParameters";

var cmd = host + " " + compilerPath + " " + options + " ";
cmd = cmd + sources.join(" ");
Expand Down Expand Up @@ -1110,7 +1116,7 @@ desc("Compiles tslint rules to js");
task("build-rules", ["build-rules-start"].concat(tslintRulesOutFiles).concat(["build-rules-end"]));
tslintRulesFiles.forEach(function (ruleFile, i) {
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false,
{ noOutFile: true, generateDeclarations: false, outDir: path.join(builtLocalDirectory, "tslint") });
{ noOutFile: true, generateDeclarations: false, outDir: path.join(builtLocalDirectory, "tslint"), lib: "es6" });
});

desc("Emit the start of the build-rules fold");
Expand Down
3 changes: 2 additions & 1 deletion scripts/parallel-lint.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var tslint = require("tslint");
var fs = require("fs");
var path = require("path");

function getLinterOptions() {
return {
Expand All @@ -9,7 +10,7 @@ function getLinterOptions() {
};
}
function getLinterConfiguration() {
return require("../tslint.json");
return tslint.Configuration.loadConfigurationFromPath(path.join(__dirname, "../tslint.json"));
}

function lintFileContents(options, configuration, path, contents) {
Expand Down

0 comments on commit b152034

Please sign in to comment.