Skip to content

Commit d941c2b

Browse files
clydinalexeagle
authored andcommitted
refactor(@schematics/angular): remove redundant branchAndMerge rules
1 parent 26f3475 commit d941c2b

File tree

18 files changed

+18
-42
lines changed

18 files changed

+18
-42
lines changed

packages/schematics/angular/class/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Tree,
1414
apply,
1515
applyTemplates,
16-
branchAndMerge,
1716
chain,
1817
filter,
1918
mergeWith,
@@ -57,7 +56,7 @@ export default function (options: ClassOptions): Rule {
5756
]);
5857

5958
return chain([
60-
branchAndMerge(mergeWith(templateSource)),
59+
mergeWith(templateSource),
6160
options.lintFix ? applyLintFix(options.path) : noop(),
6261
]);
6362
};

packages/schematics/angular/component/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
Tree,
1313
apply,
1414
applyTemplates,
15-
branchAndMerge,
1615
chain,
1716
filter,
1817
mergeWith,
@@ -167,10 +166,8 @@ export default function (options: ComponentOptions): Rule {
167166
]);
168167

169168
return chain([
170-
branchAndMerge(chain([
171-
addDeclarationToNgModule(options),
172-
mergeWith(templateSource),
173-
])),
169+
addDeclarationToNgModule(options),
170+
mergeWith(templateSource),
174171
options.lintFix ? applyLintFix(options.path) : noop(),
175172
]);
176173
};

packages/schematics/angular/directive/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
Tree,
1313
apply,
1414
applyTemplates,
15-
branchAndMerge,
1615
chain,
1716
filter,
1817
mergeWith,
@@ -135,10 +134,8 @@ export default function (options: DirectiveOptions): Rule {
135134
]);
136135

137136
return chain([
138-
branchAndMerge(chain([
139-
addDeclarationToNgModule(options),
140-
mergeWith(templateSource),
141-
])),
137+
addDeclarationToNgModule(options),
138+
mergeWith(templateSource),
142139
options.lintFix ? applyLintFix(options.path) : noop(),
143140
]);
144141
};

packages/schematics/angular/enum/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Tree,
1414
apply,
1515
applyTemplates,
16-
branchAndMerge,
1716
chain,
1817
mergeWith,
1918
move,
@@ -50,9 +49,7 @@ export default function (options: EnumOptions): Rule {
5049
]);
5150

5251
return chain([
53-
branchAndMerge(chain([
54-
mergeWith(templateSource),
55-
])),
52+
mergeWith(templateSource),
5653
options.lintFix ? applyLintFix(options.path) : noop(),
5754
]);
5855
};

packages/schematics/angular/guard/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
Tree,
1313
apply,
1414
applyTemplates,
15-
branchAndMerge,
1615
chain,
1716
filter,
1817
mergeWith,
@@ -70,9 +69,7 @@ export default function (options: GuardOptions): Rule {
7069
]);
7170

7271
return chain([
73-
branchAndMerge(chain([
74-
mergeWith(templateSource),
75-
])),
72+
mergeWith(templateSource),
7673
options.lintFix ? applyLintFix(options.path) : noop(),
7774
]);
7875
};

packages/schematics/angular/interface/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
Tree,
1313
apply,
1414
applyTemplates,
15-
branchAndMerge,
1615
chain,
1716
mergeWith,
1817
move,
@@ -52,9 +51,7 @@ export default function (options: InterfaceOptions): Rule {
5251
]);
5352

5453
return chain([
55-
branchAndMerge(chain([
56-
mergeWith(templateSource),
57-
])),
54+
mergeWith(templateSource),
5855
options.lintFix ? applyLintFix(options.path) : noop(),
5956
]);
6057
};

0 commit comments

Comments
 (0)