Skip to content

Commit 2dff301

Browse files
devversionandrewseguin
authored andcommitted
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)
1 parent b0a1daf commit 2dff301

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/cdk/schematics/utils/build-component.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* tslint:disable */
2-
31
/**
42
* @license
53
* Copyright Google LLC All Rights Reserved.
@@ -58,7 +56,7 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule {
5856
}
5957

6058
const modulePath = options.module;
61-
const source = readIntoSourceFile(host, modulePath);
59+
let source = readIntoSourceFile(host, modulePath);
6260

6361
const componentPath = `/${options.path}/`
6462
+ (options.flat ? '' : strings.dasherize(options.name) + '/')
@@ -83,9 +81,9 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule {
8381

8482
if (options.export) {
8583
// Need to refresh the AST because we overwrote the file in the host.
86-
const source = readIntoSourceFile(host, modulePath);
87-
const exportRecorder = host.beginUpdate(modulePath);
84+
source = readIntoSourceFile(host, modulePath);
8885

86+
const exportRecorder = host.beginUpdate(modulePath);
8987
const exportChanges = addExportToModule(
9088
source,
9189
modulePath,
@@ -102,9 +100,9 @@ function addDeclarationToNgModule(options: ComponentOptions): Rule {
102100

103101
if (options.entryComponent) {
104102
// Need to refresh the AST because we overwrote the file in the host.
105-
const source = readIntoSourceFile(host, modulePath);
106-
const entryComponentRecorder = host.beginUpdate(modulePath);
103+
source = readIntoSourceFile(host, modulePath);
107104

105+
const entryComponentRecorder = host.beginUpdate(modulePath);
108106
const entryComponentChanges = addEntryComponentToModule(
109107
source,
110108
modulePath,

0 commit comments

Comments
 (0)