Skip to content

Commit e6e305b

Browse files
crisbetoandrewseguin
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.
1 parent d9d4bf3 commit e6e305b

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed

src/dev-app/tsconfig-aot.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// TypeScript config that extends the dev-app tsconfig file. This config compiles the
2+
// "main-aot.ts" file and also enables templage code generation / AOT.
3+
{
4+
"extends": "./tsconfig-build",
5+
"compilerOptions": {
6+
// Needed for Moment.js since it doesn't have a default export.
7+
"allowSyntheticDefaultImports": true,
8+
"experimentalDecorators": true,
9+
"noUnusedParameters": false,
10+
"noUnusedLocals": false,
11+
"strictNullChecks": true,
12+
"noImplicitReturns": true,
13+
"strictFunctionTypes": true,
14+
"noImplicitAny": true,
15+
"noImplicitThis": true,
16+
"outDir": "../../dist/packages/dev-app",
17+
"rootDirs": [
18+
".",
19+
// Include the package output here because otherwise NGC won't be able to load
20+
// the SCSS files.
21+
"../../dist/packages/dev-app"
22+
],
23+
"paths": {
24+
"@angular/material/*": ["../../dist/releases/material/*"],
25+
"@angular/cdk/*": ["../../dist/releases/cdk/*"],
26+
"@angular/cdk": ["../../dist/releases/cdk"],
27+
"@angular/material-experimental/*": ["../../dist/releases/material-experimental/*"],
28+
"@angular/material-experimental": ["../../dist/releases/material-experimental"],
29+
"@angular/cdk-experimental/*": ["../../dist/releases/cdk-experimental/*"],
30+
"@angular/cdk-experimental": ["../../dist/releases/cdk-experimental"],
31+
"@angular/material-moment-adapter": ["../../dist/releases/material-moment-adapter"],
32+
"@angular/google-maps/*": ["../../dist/releases/google-maps/*"],
33+
"@angular/material-examples": ["../../dist/releases/material-examples"]
34+
}
35+
},
36+
"include": [
37+
"./typings.d.ts",
38+
"./main-aot.ts",
39+
"**/*-module.ts"
40+
],
41+
"angularCompilerOptions": {
42+
"skipTemplateCodegen": false,
43+
"fullTemplateTypeCheck": true
44+
}
45+
}

src/dev-app/tsconfig-build.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// TypeScript config file that is used to compile the dev-app. Target environment will be ES5,
2+
// since the dev-app will be served in the browser.
3+
{
4+
"compilerOptions": {
5+
// Needed for Moment.js since it doesn't have a default export.
6+
"allowSyntheticDefaultImports": true,
7+
"declaration": false,
8+
"emitDecoratorMetadata": true,
9+
"experimentalDecorators": true,
10+
"noUnusedParameters": false,
11+
"noUnusedLocals": false,
12+
"strictNullChecks": true,
13+
"noImplicitReturns": true,
14+
"strictFunctionTypes": true,
15+
"noImplicitThis": true,
16+
"lib": ["es6", "es2015", "dom"],
17+
"skipLibCheck": true,
18+
"module": "commonjs",
19+
"moduleResolution": "node",
20+
"noEmitOnError": true,
21+
"noImplicitAny": true,
22+
"outDir": "../../dist/packages/dev-app",
23+
"sourceMap": true,
24+
"target": "es5",
25+
"stripInternal": false,
26+
"typeRoots": [
27+
"../../node_modules/@types/!(node)"
28+
],
29+
"baseUrl": ".",
30+
"paths": {
31+
"@angular/material/*": ["../../dist/packages/material/*"],
32+
"@angular/cdk/*": ["../../dist/packages/cdk/*"],
33+
"@angular/cdk": ["../../dist/packages/cdk"],
34+
"@angular/material-experimental/*": ["../../dist/packages/material-experimental/*"],
35+
"@angular/material-experimental": ["../../dist/packages/material-experimental"],
36+
"@angular/cdk-experimental/*": ["../../dist/packages/cdk-experimental/*"],
37+
"@angular/cdk-experimental": ["../../dist/packages/cdk-experimental"],
38+
"@angular/material-moment-adapter": ["../../dist/packages/material-moment-adapter"],
39+
"@angular/google-maps/*": ["../../dist/packages/google-maps/*"],
40+
"@angular/material-examples": ["../../dist/packages/material-examples"]
41+
}
42+
},
43+
"include": [
44+
"./typings.d.ts",
45+
"./system-rxjs-operators.ts",
46+
"./system-config.ts",
47+
"./main.ts",
48+
"**/*-module.ts"
49+
]
50+
}

0 commit comments

Comments
 (0)