Skip to content

build: enable noUnusedParameters check #5091

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
Jun 13, 2017
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/cdk/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"importHelpers": true,
"module": "es2015",
"moduleResolution": "node",
Expand Down
2 changes: 2 additions & 0 deletions src/demo-app/tsconfig-aot.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"extends": "./tsconfig-build",
"compilerOptions": {
"experimentalDecorators": true,
// TODO(paul): Remove once Angular has been upgraded and supports noUnusedParameters in AOT.
"noUnusedParameters": false,
"outDir": ".",
"paths": {
"@angular/material": ["./material"],
Expand Down
1 change: 1 addition & 0 deletions src/demo-app/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noUnusedParameters": true,
"lib": ["es6", "es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
Expand Down
2 changes: 2 additions & 0 deletions src/e2e-app/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
// TODO(paul): Remove once Angular has been upgraded and supports noUnusedParameters in AOT.
"noUnusedParameters": false,
"lib": ["es6", "es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/expansion/expansion-panel-header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class MdExpansionPanelHeader {
constructor(@Host() public panel: MdExpansionPanel) {}

/** Toggles the expanded state of the panel. */
_toggle(event?: KeyboardEvent): void {
_toggle(): void {
this.panel.toggle();
}

Expand Down
1 change: 1 addition & 0 deletions src/lib/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"importHelpers": true,
"module": "es2015",
"moduleResolution": "node",
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 @@ -5,6 +5,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"importHelpers": true,
"module": "es2015",
"moduleResolution": "node",
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 @@ -5,6 +5,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": ".",
Expand Down
2 changes: 2 additions & 0 deletions src/universal-app/tsconfig-prerender.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"declaration": false,
"stripInternal": false,
"experimentalDecorators": true,
// TODO(paul): Remove once Angular has been upgraded and supports noUnusedParameters in AOT.
"noUnusedParameters": false,
"module": "commonjs",
"moduleResolution": "node",
"outDir": ".",
Expand Down
4 changes: 2 additions & 2 deletions tools/gulp/packaging/inline-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function inlineResources(filePath: string) {

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

/** Inlines the external styles of Angular components for a specified source file. */
function inlineStyles(fileContent: string, filePath: string) {
return fileContent.replace(/styleUrls:\s*(\[[\s\S]*?])/gm, (match, styleUrlsValue) => {
return fileContent.replace(/styleUrls:\s*(\[[\s\S]*?])/gm, (_match, styleUrlsValue) => {
// The RegExp matches the array of external style files. This is a string right now and
// can to be parsed using the `eval` method. The value looks like "['AAA.css', 'BBB.css']"
const styleUrls = eval(styleUrlsValue) as string[];
Expand Down
4 changes: 2 additions & 2 deletions tools/gulp/tasks/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ function transformMarkdownFiles(buffer: Buffer, file: any): string {
let content = buffer.toString('utf-8');

// Replace <!-- example(..) --> comments with HTML elements.
content = content.replace(EXAMPLE_PATTERN, (match: string, name: string) =>
content = content.replace(EXAMPLE_PATTERN, (_match: string, name: string) =>
`<div material-docs-example="${name}"></div>`
);

// Replace the URL in anchor elements inside of compiled markdown files.
content = content.replace(LINK_PATTERN, (match: string, head: string, link: string) =>
content = content.replace(LINK_PATTERN, (_match: string, head: string, link: string) =>
// The head is the first match of the RegExp and is necessary to ensure that the RegExp matches
// an anchor element. The head will be then used to re-create the existing anchor element.
// If the head is not prepended to the replaced value, then the first match will be lost.
Expand Down
1 change: 1 addition & 0 deletions tools/gulp/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"noUnusedParameters": true,
"lib": ["es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
Expand Down
2 changes: 1 addition & 1 deletion tools/gulp/util/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const screenshotFirebaseConfig = require('../../screenshot-test/functions/config
const dashboardDatabaseUrl = 'https://material2-board.firebaseio.com';

/** Opens a connection to the Firebase dashboard app using a service account. */
export function openFirebaseDashboardApp(asGuest = false) {
export function openFirebaseDashboardApp() {
// Initialize the Firebase application with firebaseAdmin credentials.
// Credentials need to be for a Service Account, which can be created in the Firebase console.
return firebaseAdmin.initializeApp({
Expand Down