Skip to content

use ES6 library when building tslint rules #14474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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