Skip to content

Commit 38e0b71

Browse files
committed
use ES6 library when building tslint rules (#14474)
1 parent f6b1738 commit 38e0b71

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
@@ -317,8 +317,14 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts
317317
if (opts.stripInternal) {
318318
options += " --stripInternal";
319319
}
320-
321-
options += " --target es5 --lib es5,scripthost --noUnusedLocals --noUnusedParameters";
320+
options += " --target es5";
321+
if (opts.lib) {
322+
options += " --lib " + opts.lib
323+
}
324+
else {
325+
options += " --lib es5,scripthost"
326+
}
327+
options += " --noUnusedLocals --noUnusedParameters";
322328

323329
var cmd = host + " " + compilerPath + " " + options + " ";
324330
cmd = cmd + sources.join(" ");
@@ -1077,7 +1083,7 @@ desc("Compiles tslint rules to js");
10771083
task("build-rules", ["build-rules-start"].concat(tslintRulesOutFiles).concat(["build-rules-end"]));
10781084
tslintRulesFiles.forEach(function (ruleFile, i) {
10791085
compileFile(tslintRulesOutFiles[i], [ruleFile], [ruleFile], [], /*useBuiltCompiler*/ false,
1080-
{ noOutFile: true, generateDeclarations: false, outDir: path.join(builtLocalDirectory, "tslint") });
1086+
{ noOutFile: true, generateDeclarations: false, outDir: path.join(builtLocalDirectory, "tslint"), lib: "es6" });
10811087
});
10821088

10831089
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)