Skip to content

build: enable noImplicitReturns compiler option #16672

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/bazel-tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"noUnusedParameters": false,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ export class FlexibleConnectedPositionStrategy implements PositionStrategy {

return verticalFit && horizontalFit;
}
return false;
}

/**
Expand Down
1 change: 1 addition & 0 deletions src/cdk/schematics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"outDir": "../../../dist/packages/cdk/schematics",
"noEmitOnError": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
Expand Down
8 changes: 3 additions & 5 deletions src/cdk/tree/nested-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ export class CdkNestedTreeNode<T> extends CdkTreeNode<T> implements AfterContent
private _getNodeOutlet() {
const outlets = this.nodeOutlet;

if (outlets) {
// Note that since we use `descendants: true` on the query, we have to ensure
// that we don't pick up the outlet of a child node by accident.
return outlets.find(outlet => !outlet._node || outlet._node === this);
}
// Note that since we use `descendants: true` on the query, we have to ensure
// that we don't pick up the outlet of a child node by accident.
return outlets && outlets.find(outlet => !outlet._node || outlet._node === this);
}
}
1 change: 1 addition & 0 deletions src/dev-app/tsconfig-aot.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"noUnusedParameters": false,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down
1 change: 1 addition & 0 deletions src/dev-app/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"noUnusedParameters": false,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"lib": ["es6", "es2015", "dom"],
Expand Down
1 change: 1 addition & 0 deletions src/material-examples/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"noUnusedParameters": false,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down
1 change: 1 addition & 0 deletions src/material-moment-adapter/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"noUnusedParameters": false,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down
1 change: 1 addition & 0 deletions src/material/progress-bar/progress-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export class MatProgressBar extends _MatProgressBarMixinBase implements CanColor
const scale = this.bufferValue / 100;
return {transform: `scaleX(${scale})`};
}
return undefined;
}

ngAfterViewInit() {
Expand Down
1 change: 1 addition & 0 deletions src/material/schematics/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"outDir": "../../../dist/packages/material/schematics",
"noEmitOnError": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"skipDefaultLibCheck": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
Expand Down
1 change: 1 addition & 0 deletions src/universal-app/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"noUnusedParameters": false,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down
1 change: 1 addition & 0 deletions src/universal-app/tsconfig-prerender.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"noUnusedParameters": false,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down
13 changes: 6 additions & 7 deletions tools/dgeni/common/decorators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ export function isPrimaryModuleDoc(doc: any) {
}

export function getDirectiveSelectors(classDoc: CategorizedClassDoc) {
if (!classDoc.directiveMetadata) {
return;
}

const directiveSelectors: string = classDoc.directiveMetadata.get('selector');
if (classDoc.directiveMetadata) {
const directiveSelectors: string = classDoc.directiveMetadata.get('selector');

if (directiveSelectors) {
return directiveSelectors.replace(/[\r\n]/g, '').split(/\s*,\s*/).filter(s => s !== '');
if (directiveSelectors) {
return directiveSelectors.replace(/[\r\n]/g, '').split(/\s*,\s*/).filter(s => s !== '');
}
}
return undefined;
}

export function hasMemberDecorator(doc: MemberDoc, decoratorName: string) {
Expand Down
2 changes: 2 additions & 0 deletions tools/dgeni/common/property-bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ function getBindingPropertyData(doc: PropertyMemberDoc, metadata: Map<string, an
alias: doc.decorators!.find(d => d.name == decoratorName)!.arguments![0]
};
}

return undefined;
}
1 change: 1 addition & 0 deletions tools/dgeni/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["es2015", "dom", "es2016.array.include"],
"moduleResolution": "node",
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noImplicitAny": true,
Expand Down
1 change: 1 addition & 0 deletions tools/gulp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"moduleResolution": "node",
"outDir": "../../dist/tools/gulp",
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"noEmitOnError": true,
Expand Down
4 changes: 2 additions & 2 deletions tools/package-tools/build-bundles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ export class PackageBundler {
context: 'this',
external: Object.keys(rollupGlobals),
input: config.entry,
onwarn: (warning: any) => {
onwarn: (warning: {message: string, code: string}) => {
// TODO(jelbourn): figure out *why* rollup warns about certain symbols not being found
// when those symbols don't appear to be in the input file in the first place.
if (/but never used/.test(warning.message)) {
return false;
return;
}

if (warning.code === 'CIRCULAR_DEPENDENCY') {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": false,
"strictNullChecks": true,
"noImplicitReturns": true,
"strictFunctionTypes": true,
"noImplicitAny": true,
"noImplicitThis": true,
Expand Down