Skip to content

Commit b9ea60a

Browse files
crisbetommalerba
authored andcommitted
build: enable noImplicitReturns compiler option (#16672)
Turns on the `noImplicitReturns` compiler option and fixes any errors that show up as a result. Fixes #16669. (cherry picked from commit cf70c43)
1 parent 688d3f4 commit b9ea60a

File tree

18 files changed

+27
-14
lines changed

18 files changed

+27
-14
lines changed

src/bazel-tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"noUnusedParameters": true,
1313
"noUnusedLocals": true,
1414
"strictNullChecks": true,
15+
"noImplicitReturns": true,
1516
"strictFunctionTypes": true,
1617
"noFallthroughCasesInSwitch": true,
1718
"noImplicitAny": true,

src/cdk/overlay/position/flexible-connected-position-strategy.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,7 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {
574574

575575
return verticalFit && horizontalFit;
576576
}
577+
return false;
577578
}
578579

579580
/**

src/cdk/schematics/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"outDir": "../../../dist/packages/cdk/schematics",
99
"noEmitOnError": false,
1010
"strictNullChecks": true,
11+
"noImplicitReturns": true,
1112
"skipDefaultLibCheck": true,
1213
"skipLibCheck": true,
1314
"sourceMap": true,

src/cdk/tree/nested-node.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,8 @@ export class CdkNestedTreeNode<T> extends CdkTreeNode<T> implements AfterContent
126126
private _getNodeOutlet() {
127127
const outlets = this.nodeOutlet;
128128

129-
if (outlets) {
130-
// Note that since we use `descendants: true` on the query, we have to ensure
131-
// that we don't pick up the outlet of a child node by accident.
132-
return outlets.find(outlet => !outlet._node || outlet._node === this);
133-
}
129+
// Note that since we use `descendants: true` on the query, we have to ensure
130+
// that we don't pick up the outlet of a child node by accident.
131+
return outlets && outlets.find(outlet => !outlet._node || outlet._node === this);
134132
}
135133
}

src/dev-app/tsconfig-aot.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"noUnusedParameters": true,
1010
"noUnusedLocals": true,
1111
"strictNullChecks": true,
12+
"noImplicitReturns": true,
1213
"strictFunctionTypes": true,
1314
"noImplicitAny": true,
1415
"noImplicitThis": true,

src/dev-app/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"noUnusedParameters": true,
1111
"noUnusedLocals": true,
1212
"strictNullChecks": true,
13+
"noImplicitReturns": true,
1314
"strictFunctionTypes": true,
1415
"noImplicitThis": true,
1516
"lib": ["es6", "es2015", "dom"],

src/material-examples/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"noUnusedParameters": true,
1111
"noUnusedLocals": true,
1212
"strictNullChecks": true,
13+
"noImplicitReturns": true,
1314
"strictFunctionTypes": true,
1415
"noImplicitAny": true,
1516
"noImplicitThis": true,

src/material-moment-adapter/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"noUnusedParameters": true,
1111
"noUnusedLocals": true,
1212
"strictNullChecks": true,
13+
"noImplicitReturns": true,
1314
"strictFunctionTypes": true,
1415
"noImplicitAny": true,
1516
"noImplicitThis": true,

src/material/progress-bar/progress-bar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export class MatProgressBar extends _MatProgressBarMixinBase implements CanColor
188188
const scale = this.bufferValue / 100;
189189
return {transform: `scaleX(${scale})`};
190190
}
191+
return undefined;
191192
}
192193

193194
ngAfterViewInit() {

src/material/schematics/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"outDir": "../../../dist/packages/material/schematics",
77
"noEmitOnError": false,
88
"strictNullChecks": true,
9+
"noImplicitReturns": true,
910
"skipDefaultLibCheck": true,
1011
"noUnusedLocals": true,
1112
"noUnusedParameters": true,

0 commit comments

Comments
 (0)