Skip to content

Commit de68202

Browse files
devversionkara
authored andcommitted
build: enable noUnusedParameters check (#5091)
1 parent 46edae6 commit de68202

File tree

13 files changed

+18
-6
lines changed

13 files changed

+18
-6
lines changed

src/cdk/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"declaration": true,
77
"stripInternal": false,
88
"experimentalDecorators": true,
9+
"noUnusedParameters": true,
910
"importHelpers": true,
1011
"module": "es2015",
1112
"moduleResolution": "node",

src/demo-app/tsconfig-aot.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"extends": "./tsconfig-build",
66
"compilerOptions": {
77
"experimentalDecorators": true,
8+
// TODO(paul): Remove once Angular has been upgraded and supports noUnusedParameters in AOT.
9+
"noUnusedParameters": false,
810
"outDir": ".",
911
"paths": {
1012
"@angular/material": ["./material"],

src/demo-app/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": false,
66
"emitDecoratorMetadata": true,
77
"experimentalDecorators": true,
8+
"noUnusedParameters": true,
89
"lib": ["es6", "es2015", "dom"],
910
"module": "commonjs",
1011
"moduleResolution": "node",

src/e2e-app/tsconfig-build.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"declaration": true,
66
"emitDecoratorMetadata": true,
77
"experimentalDecorators": true,
8+
// TODO(paul): Remove once Angular has been upgraded and supports noUnusedParameters in AOT.
9+
"noUnusedParameters": false,
810
"lib": ["es6", "es2015", "dom"],
911
"module": "commonjs",
1012
"moduleResolution": "node",

src/lib/expansion/expansion-panel-header.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class MdExpansionPanelHeader {
5656
constructor(@Host() public panel: MdExpansionPanel) {}
5757

5858
/** Toggles the expanded state of the panel. */
59-
_toggle(event?: KeyboardEvent): void {
59+
_toggle(): void {
6060
this.panel.toggle();
6161
}
6262

src/lib/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": true,
66
"stripInternal": false,
77
"experimentalDecorators": true,
8+
"noUnusedParameters": true,
89
"importHelpers": true,
910
"module": "es2015",
1011
"moduleResolution": "node",

src/material-examples/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": true,
66
"stripInternal": false,
77
"experimentalDecorators": true,
8+
"noUnusedParameters": true,
89
"importHelpers": true,
910
"module": "es2015",
1011
"moduleResolution": "node",

src/universal-app/tsconfig-build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": true,
66
"stripInternal": false,
77
"experimentalDecorators": true,
8+
"noUnusedParameters": true,
89
"module": "commonjs",
910
"moduleResolution": "node",
1011
"outDir": ".",

src/universal-app/tsconfig-prerender.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"declaration": false,
55
"stripInternal": false,
66
"experimentalDecorators": true,
7+
// TODO(paul): Remove once Angular has been upgraded and supports noUnusedParameters in AOT.
8+
"noUnusedParameters": false,
79
"module": "commonjs",
810
"moduleResolution": "node",
911
"outDir": ".",

tools/gulp/packaging/inline-resources.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function inlineResources(filePath: string) {
2222

2323
/** Inlines the templates of Angular components for a specified source file. */
2424
function inlineTemplate(fileContent: string, filePath: string) {
25-
return fileContent.replace(/templateUrl:\s*'([^']+?\.html)'/g, (match, templateUrl) => {
25+
return fileContent.replace(/templateUrl:\s*'([^']+?\.html)'/g, (_match, templateUrl) => {
2626
const templatePath = join(dirname(filePath), templateUrl);
2727
const templateContent = loadResourceFile(templatePath);
2828
return `template: "${templateContent}"`;
@@ -31,7 +31,7 @@ function inlineTemplate(fileContent: string, filePath: string) {
3131

3232
/** Inlines the external styles of Angular components for a specified source file. */
3333
function inlineStyles(fileContent: string, filePath: string) {
34-
return fileContent.replace(/styleUrls:\s*(\[[\s\S]*?])/gm, (match, styleUrlsValue) => {
34+
return fileContent.replace(/styleUrls:\s*(\[[\s\S]*?])/gm, (_match, styleUrlsValue) => {
3535
// The RegExp matches the array of external style files. This is a string right now and
3636
// can to be parsed using the `eval` method. The value looks like "['AAA.css', 'BBB.css']"
3737
const styleUrls = eval(styleUrlsValue) as string[];

0 commit comments

Comments
 (0)