Skip to content

Commit b152034

Browse files
authored
use ES6 library when building tslint rules (#14474)
1 parent 19e88ac commit b152034

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Jakefile.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,14 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
328328
if (opts.stripInternal) {
329329
options += " --stripInternal";
330330
}
331-
332-
options += " --target es5 --lib es5,scripthost --noUnusedLocals --noUnusedParameters";
331+
options += " --target es5";
332+
if (opts.lib) {
333+
options += " --lib " + opts.lib
334+
}
335+
else {
336+
options += " --lib es5,scripthost"
337+
}
338+
options += " --noUnusedLocals --noUnusedParameters";
333339

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

11161122
desc("Emit the start of the build-rules fold");

scripts/parallel-lint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var tslint = require("tslint");
22
var fs = require("fs");
3+
var path = require("path");
34

45
function getLinterOptions() {
56
return {
@@ -9,7 +10,7 @@ function getLinterOptions() {
910
};
1011
}
1112
function getLinterConfiguration() {
12-
return require("../tslint.json");
13+
return tslint.Configuration.loadConfigurationFromPath(path.join(__dirname, "../tslint.json"));
1314
}
1415

1516
function lintFileContents(options, configuration, path, contents) {

0 commit comments

Comments
 (0)