From 2dff30161d3fe4ecc0ecc6aaebf87e4e50282861 Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Wed, 10 Oct 2018 20:28:53 +0200 Subject: [PATCH] chore(schematics): re-enable linting for ignored file (#13542) * Re-enables linting for the `build-component` file which has been originally copied from `@schematics/angular`. For some reason, linting has been disabled explicitly for this file. This re-enables TSLint. * Also fixes a few shadowed variable failures (this logic comes from the `@schematics/angular:component` schematic and **should** be kept as similar as possible) --- src/cdk/schematics/utils/build-component.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/cdk/schematics/utils/build-component.ts b/src/cdk/schematics/utils/build-component.ts index 8b4829202fc..71c547c3843 100644 --- a/src/cdk/schematics/utils/build-component.ts +++ b/src/cdk/schematics/utils/build-component.ts @@ -1,5 +1,3 @@ -/* tslint:disable */ - /** * @license * Copyright Google LLC All Rights Reserved. @@ -58,7 +56,7 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule { } const modulePath = options.module; - const source = readIntoSourceFile(host, modulePath); + let source = readIntoSourceFile(host, modulePath); const componentPath = `/${options.path}/` + (options.flat ? '' : strings.dasherize(options.name) + '/') @@ -83,9 +81,9 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule { if (options.export) { // Need to refresh the AST because we overwrote the file in the host. - const source = readIntoSourceFile(host, modulePath); - const exportRecorder = host.beginUpdate(modulePath); + source = readIntoSourceFile(host, modulePath); + const exportRecorder = host.beginUpdate(modulePath); const exportChanges = addExportToModule( source, modulePath, @@ -102,9 +100,9 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule { if (options.entryComponent) { // Need to refresh the AST because we overwrote the file in the host. - const source = readIntoSourceFile(host, modulePath); - const entryComponentRecorder = host.beginUpdate(modulePath); + source = readIntoSourceFile(host, modulePath); + const entryComponentRecorder = host.beginUpdate(modulePath); const entryComponentChanges = addEntryComponentToModule( source, modulePath,