From b883fcbfddcbaab6764166fc6abd3c72f11ba577 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 2 Oct 2017 08:36:26 -0700 Subject: [PATCH] Enable "space-within-parens" lint rule (#18856) --- src/compiler/transformers/esnext.ts | 2 +- src/harness/unittests/cachingInServerLSHost.ts | 2 +- src/lib/es2015.core.d.ts | 2 +- tslint.json | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/transformers/esnext.ts b/src/compiler/transformers/esnext.ts index 97b555e01b7..5b4c12b4f23 100644 --- a/src/compiler/transformers/esnext.ts +++ b/src/compiler/transformers/esnext.ts @@ -378,7 +378,7 @@ namespace ts { const catchVariable = getGeneratedNameForNode(errorRecord); const returnMethod = createTempVariable(/*recordTempVariable*/ undefined); const callValues = createAsyncValuesHelper(context, expression, /*location*/ node.expression); - const callNext = createCall(createPropertyAccess(iterator, "next" ), /*typeArguments*/ undefined, []); + const callNext = createCall(createPropertyAccess(iterator, "next"), /*typeArguments*/ undefined, []); const getDone = createPropertyAccess(result, "done"); const getValue = createPropertyAccess(result, "value"); const callReturn = createFunctionCall(returnMethod, iterator, []); diff --git a/src/harness/unittests/cachingInServerLSHost.ts b/src/harness/unittests/cachingInServerLSHost.ts index 7c832b210b7..489c3c5fdd3 100644 --- a/src/harness/unittests/cachingInServerLSHost.ts +++ b/src/harness/unittests/cachingInServerLSHost.ts @@ -64,7 +64,7 @@ namespace ts { const rootScriptInfo = projectService.getOrCreateScriptInfo(rootFile, /* openedByClient */ true, /*containingProject*/ undefined); const project = projectService.createInferredProjectWithRootFileIfNecessary(rootScriptInfo); - project.setCompilerOptions({ module: ts.ModuleKind.AMD, noLib: true } ); + project.setCompilerOptions({ module: ts.ModuleKind.AMD, noLib: true }); return { project, rootScriptInfo diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index e7c0d479711..5c2438d9052 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -162,7 +162,7 @@ interface Math { * If any argument is NaN, the result is NaN. * If all arguments are either +0 or −0, the result is +0. */ - hypot(...values: number[] ): number; + hypot(...values: number[]): number; /** * Returns the integral part of the a numeric expression, x, removing any fractional digits. diff --git a/tslint.json b/tslint.json index 7e1830dc736..d5a182ff0cc 100644 --- a/tslint.json +++ b/tslint.json @@ -41,6 +41,7 @@ "avoid-escape" ], "semicolon": [true, "always", "ignore-bound-class-methods"], + "space-within-parens": true, "triple-equals": true, "type-operator-spacing": true, "typedef-whitespace": [