build: enable noUnusedParameters check (#5091)

This commit is contained in:
Paul Gschwendtner
2017-06-13 20:48:02 +02:00
committed by Kara
parent 46edae64ba
commit de68202971
13 changed files with 18 additions and 6 deletions
+1
View File
@@ -6,6 +6,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"importHelpers": true,
"module": "es2015",
"moduleResolution": "node",
+2
View File
@@ -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"],
+1
View File
@@ -5,6 +5,7 @@
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noUnusedParameters": true,
"lib": ["es6", "es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
+2
View File
@@ -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",
+1 -1
View File
@@ -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();
}
+1
View File
@@ -5,6 +5,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"importHelpers": true,
"module": "es2015",
"moduleResolution": "node",
@@ -5,6 +5,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"importHelpers": true,
"module": "es2015",
"moduleResolution": "node",
+1
View File
@@ -5,6 +5,7 @@
"declaration": true,
"stripInternal": false,
"experimentalDecorators": true,
"noUnusedParameters": true,
"module": "commonjs",
"moduleResolution": "node",
"outDir": ".",
@@ -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": ".",
+2 -2
View File
@@ -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}"`;
@@ -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[];
+2 -2
View File
@@ -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.
+1
View File
@@ -3,6 +3,7 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"noUnusedParameters": true,
"lib": ["es2015", "dom"],
"module": "commonjs",
"moduleResolution": "node",
+1 -1
View File
@@ -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({