mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-03 09:32:20 -05:00
Update linting to avoid typechecking for booleanTriviaRule
This commit is contained in:
46
Gulpfile.ts
46
Gulpfile.ts
@@ -175,7 +175,7 @@ for (const i in libraryTargets) {
|
||||
const sources = [copyright].concat(entry.sources.map(function(s) {
|
||||
return path.join(libraryDirectory, s);
|
||||
}));
|
||||
gulp.task(target, false, [], function() {
|
||||
gulp.task(target, /*help*/ false, [], function() {
|
||||
return gulp.src(sources)
|
||||
.pipe(newer(target))
|
||||
.pipe(concat(target, { newLine: "\n\n" }))
|
||||
@@ -275,7 +275,7 @@ function getCompilerSettings(base: tsc.Settings, useBuiltCompiler?: boolean): ts
|
||||
return copy;
|
||||
}
|
||||
|
||||
gulp.task(configureNightlyJs, false, [], () => {
|
||||
gulp.task(configureNightlyJs, /*help*/ false, [], () => {
|
||||
const settings: tsc.Settings = {
|
||||
declaration: false,
|
||||
removeComments: true,
|
||||
@@ -304,7 +304,7 @@ const importDefinitelyTypedTestsDirectory = path.join(scriptsDirectory, "importD
|
||||
const importDefinitelyTypedTestsJs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.js");
|
||||
const importDefinitelyTypedTestsTs = path.join(importDefinitelyTypedTestsDirectory, "importDefinitelyTypedTests.ts");
|
||||
|
||||
gulp.task(importDefinitelyTypedTestsJs, false, [], () => {
|
||||
gulp.task(importDefinitelyTypedTestsJs, /*help*/ false, [], () => {
|
||||
const settings: tsc.Settings = getCompilerSettings({
|
||||
declaration: false,
|
||||
removeComments: true,
|
||||
@@ -335,7 +335,7 @@ const generatedDiagnosticMessagesJSON = path.join(compilerDirectory, "diagnostic
|
||||
const builtGeneratedDiagnosticMessagesJSON = path.join(builtLocalDirectory, "diagnosticMessages.generated.json");
|
||||
|
||||
// processDiagnosticMessages script
|
||||
gulp.task(processDiagnosticMessagesJs, false, [], () => {
|
||||
gulp.task(processDiagnosticMessagesJs, /*help*/ false, [], () => {
|
||||
const settings: tsc.Settings = getCompilerSettings({
|
||||
target: "es5",
|
||||
declaration: false,
|
||||
@@ -383,7 +383,7 @@ function prependCopyright(outputCopyright: boolean = !useDebugMode) {
|
||||
return insert.prepend(outputCopyright ? (copyrightContent || (copyrightContent = fs.readFileSync(copyright).toString())) : "");
|
||||
}
|
||||
|
||||
gulp.task(builtLocalCompiler, false, [servicesFile], () => {
|
||||
gulp.task(builtLocalCompiler, /*help*/ false, [servicesFile], () => {
|
||||
const localCompilerProject = tsc.createProject("src/compiler/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
|
||||
return localCompilerProject.src()
|
||||
.pipe(newer(builtLocalCompiler))
|
||||
@@ -394,7 +394,7 @@ gulp.task(builtLocalCompiler, false, [servicesFile], () => {
|
||||
.pipe(gulp.dest("src/compiler"));
|
||||
});
|
||||
|
||||
gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
|
||||
gulp.task(servicesFile, /*help*/ false, ["lib", "generate-diagnostics"], () => {
|
||||
const servicesProject = tsc.createProject("src/services/tsconfig.json", getCompilerSettings({ removeComments: false }, /*useBuiltCompiler*/false));
|
||||
const {js, dts} = servicesProject.src()
|
||||
.pipe(newer(servicesFile))
|
||||
@@ -428,7 +428,7 @@ gulp.task(servicesFile, false, ["lib", "generate-diagnostics"], () => {
|
||||
|
||||
// cancellationToken.js
|
||||
const cancellationTokenJs = path.join(builtLocalDirectory, "cancellationToken.js");
|
||||
gulp.task(cancellationTokenJs, false, [servicesFile], () => {
|
||||
gulp.task(cancellationTokenJs, /*help*/ false, [servicesFile], () => {
|
||||
const cancellationTokenProject = tsc.createProject("src/server/cancellationToken/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
|
||||
return cancellationTokenProject.src()
|
||||
.pipe(newer(cancellationTokenJs))
|
||||
@@ -441,7 +441,7 @@ gulp.task(cancellationTokenJs, false, [servicesFile], () => {
|
||||
|
||||
// typingsInstallerFile.js
|
||||
const typingsInstallerJs = path.join(builtLocalDirectory, "typingsInstaller.js");
|
||||
gulp.task(typingsInstallerJs, false, [servicesFile], () => {
|
||||
gulp.task(typingsInstallerJs, /*help*/ false, [servicesFile], () => {
|
||||
const cancellationTokenProject = tsc.createProject("src/server/typingsInstaller/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
|
||||
return cancellationTokenProject.src()
|
||||
.pipe(newer(typingsInstallerJs))
|
||||
@@ -454,7 +454,7 @@ gulp.task(typingsInstallerJs, false, [servicesFile], () => {
|
||||
|
||||
const serverFile = path.join(builtLocalDirectory, "tsserver.js");
|
||||
|
||||
gulp.task(serverFile, false, [servicesFile, typingsInstallerJs, cancellationTokenJs], () => {
|
||||
gulp.task(serverFile, /*help*/ false, [servicesFile, typingsInstallerJs, cancellationTokenJs], () => {
|
||||
const serverProject = tsc.createProject("src/server/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
|
||||
return serverProject.src()
|
||||
.pipe(newer(serverFile))
|
||||
@@ -468,7 +468,7 @@ gulp.task(serverFile, false, [servicesFile, typingsInstallerJs, cancellationToke
|
||||
const tsserverLibraryFile = path.join(builtLocalDirectory, "tsserverlibrary.js");
|
||||
const tsserverLibraryDefinitionFile = path.join(builtLocalDirectory, "tsserverlibrary.d.ts");
|
||||
|
||||
gulp.task(tsserverLibraryFile, false, [servicesFile], (done) => {
|
||||
gulp.task(tsserverLibraryFile, /*help*/ false, [servicesFile], (done) => {
|
||||
const serverLibraryProject = tsc.createProject("src/server/tsconfig.library.json", getCompilerSettings({}, /*useBuiltCompiler*/ true));
|
||||
const {js, dts}: { js: NodeJS.ReadableStream, dts: NodeJS.ReadableStream } = serverLibraryProject.src()
|
||||
.pipe(sourcemaps.init())
|
||||
@@ -497,7 +497,7 @@ const word2mdTs = path.join(scriptsDirectory, "word2md.ts");
|
||||
const specWord = path.join(docDirectory, "TypeScript Language Specification.docx");
|
||||
const specMd = path.join(docDirectory, "spec.md");
|
||||
|
||||
gulp.task(word2mdJs, false, [], () => {
|
||||
gulp.task(word2mdJs, /*help*/ false, [], () => {
|
||||
const settings: tsc.Settings = getCompilerSettings({
|
||||
outFile: word2mdJs
|
||||
}, /*useBuiltCompiler*/ false);
|
||||
@@ -509,7 +509,7 @@ gulp.task(word2mdJs, false, [], () => {
|
||||
.pipe(gulp.dest("."));
|
||||
});
|
||||
|
||||
gulp.task(specMd, false, [word2mdJs], (done) => {
|
||||
gulp.task(specMd, /*help*/ false, [word2mdJs], (done) => {
|
||||
const specWordFullPath = path.resolve(specWord);
|
||||
const specMDFullPath = path.resolve(specMd);
|
||||
const cmd = "cscript //nologo " + word2mdJs + " \"" + specWordFullPath + "\" " + "\"" + specMDFullPath + "\"";
|
||||
@@ -525,10 +525,10 @@ gulp.task("clean", "Cleans the compiler output, declare files, and tests", [], (
|
||||
return del([builtDirectory]);
|
||||
});
|
||||
|
||||
gulp.task("useDebugMode", false, [], (done) => { useDebugMode = true; done(); });
|
||||
gulp.task("dontUseDebugMode", false, [], (done) => { useDebugMode = false; done(); });
|
||||
gulp.task("useDebugMode", /*help*/ false, [], (done) => { useDebugMode = true; done(); });
|
||||
gulp.task("dontUseDebugMode", /*help*/ false, [], (done) => { useDebugMode = false; done(); });
|
||||
|
||||
gulp.task("VerifyLKG", false, [], () => {
|
||||
gulp.task("VerifyLKG", /*help*/ false, [], () => {
|
||||
const expectedFiles = [builtLocalCompiler, servicesFile, serverFile, nodePackageFile, nodeDefinitionsFile, standaloneDefinitionsFile, tsserverLibraryFile, tsserverLibraryDefinitionFile, typingsInstallerJs, cancellationTokenJs].concat(libraryTargets);
|
||||
const missingFiles = expectedFiles.filter(function(f) {
|
||||
return !fs.existsSync(f);
|
||||
@@ -541,7 +541,7 @@ gulp.task("VerifyLKG", false, [], () => {
|
||||
return gulp.src(expectedFiles).pipe(gulp.dest(LKGDirectory));
|
||||
});
|
||||
|
||||
gulp.task("LKGInternal", false, ["lib", "local"]);
|
||||
gulp.task("LKGInternal", /*help*/ false, ["lib", "local"]);
|
||||
|
||||
gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUseDebugMode"], () => {
|
||||
return runSequence("LKGInternal", "VerifyLKG");
|
||||
@@ -550,7 +550,7 @@ gulp.task("LKG", "Makes a new LKG out of the built js files", ["clean", "dontUse
|
||||
|
||||
// Task to build the tests infrastructure using the built compiler
|
||||
const run = path.join(builtLocalDirectory, "run.js");
|
||||
gulp.task(run, false, [servicesFile], () => {
|
||||
gulp.task(run, /*help*/ false, [servicesFile], () => {
|
||||
const testProject = tsc.createProject("src/harness/tsconfig.json", getCompilerSettings({}, /*useBuiltCompiler*/true));
|
||||
return testProject.src()
|
||||
.pipe(newer(run))
|
||||
@@ -724,7 +724,7 @@ gulp.task("runtests",
|
||||
|
||||
const nodeServerOutFile = "tests/webTestServer.js";
|
||||
const nodeServerInFile = "tests/webTestServer.ts";
|
||||
gulp.task(nodeServerOutFile, false, [servicesFile], () => {
|
||||
gulp.task(nodeServerOutFile, /*help*/ false, [servicesFile], () => {
|
||||
const settings: tsc.Settings = getCompilerSettings({ module: "commonjs" }, /*useBuiltCompiler*/ true);
|
||||
return gulp.src(nodeServerInFile)
|
||||
.pipe(newer(nodeServerOutFile))
|
||||
@@ -889,7 +889,7 @@ gulp.task("baseline-accept-test262", "Makes the most recent test262 test results
|
||||
// Webhost
|
||||
const webhostPath = "tests/webhost/webtsc.ts";
|
||||
const webhostJsPath = "tests/webhost/webtsc.js";
|
||||
gulp.task(webhostJsPath, false, [servicesFile], () => {
|
||||
gulp.task(webhostJsPath, /*help*/ false, [servicesFile], () => {
|
||||
const settings: tsc.Settings = getCompilerSettings({
|
||||
outFile: webhostJsPath
|
||||
}, /*useBuiltCompiler*/ true);
|
||||
@@ -909,7 +909,7 @@ gulp.task("webhost", "Builds the tsc web host", [webhostJsPath], () => {
|
||||
// Perf compiler
|
||||
const perftscPath = "tests/perftsc.ts";
|
||||
const perftscJsPath = "built/local/perftsc.js";
|
||||
gulp.task(perftscJsPath, false, [servicesFile], () => {
|
||||
gulp.task(perftscJsPath, /*help*/ false, [servicesFile], () => {
|
||||
const settings: tsc.Settings = getCompilerSettings({
|
||||
outFile: perftscJsPath
|
||||
}, /*useBuiltCompiler*/ true);
|
||||
@@ -927,10 +927,10 @@ gulp.task("perftsc", "Builds augmented version of the compiler for perf tests",
|
||||
// Instrumented compiler
|
||||
const loggedIOpath = path.join(harnessDirectory, "loggedIO.ts");
|
||||
const loggedIOJsPath = path.join(builtLocalDirectory, "loggedIO.js");
|
||||
gulp.task(loggedIOJsPath, false, [], (done) => {
|
||||
gulp.task(loggedIOJsPath, /*help*/ false, [], (done) => {
|
||||
const temp = path.join(builtLocalDirectory, "temp");
|
||||
mkdirP(temp, (err) => {
|
||||
if (err) { console.error(err); done(err); process.exit(1); };
|
||||
if (err) { console.error(err); done(err); process.exit(1); }
|
||||
exec(host, [LKGCompiler, "--types --outdir", temp, loggedIOpath], () => {
|
||||
fs.renameSync(path.join(temp, "/harness/loggedIO.js"), loggedIOJsPath);
|
||||
del(temp).then(() => done(), done);
|
||||
@@ -940,7 +940,7 @@ gulp.task(loggedIOJsPath, false, [], (done) => {
|
||||
|
||||
const instrumenterPath = path.join(harnessDirectory, "instrumenter.ts");
|
||||
const instrumenterJsPath = path.join(builtLocalDirectory, "instrumenter.js");
|
||||
gulp.task(instrumenterJsPath, false, [servicesFile], () => {
|
||||
gulp.task(instrumenterJsPath, /*help*/ false, [servicesFile], () => {
|
||||
const settings: tsc.Settings = getCompilerSettings({
|
||||
outFile: instrumenterJsPath
|
||||
}, /*useBuiltCompiler*/ true);
|
||||
|
||||
Reference in New Issue
Block a user