Skip to content

Commit d1e13ac

Browse files
filipesilvahansl
authored andcommitted
build: use noUnusedParameters, noUnusedLocals (#4882)
1 parent a4b43a5 commit d1e13ac

File tree

31 files changed

+49
-67
lines changed

31 files changed

+49
-67
lines changed

packages/@angular/cli/commands/completion.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as fs from 'fs';
22
import * as path from 'path';
33

4-
import { oneLine, stripIndent } from 'common-tags';
4+
import { stripIndent } from 'common-tags';
55

66
const stringUtils = require('ember-cli-string-utils');
77
const Command = require('../ember-cli/lib/models/command');

packages/@angular/cli/commands/doc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const DocCommand = Command.extend({
1010
'<keyword>'
1111
],
1212

13-
run: function(commandOptions: any, rawArgs: Array<string>) {
13+
run: function(_commandOptions: any, rawArgs: Array<string>) {
1414
const keyword = rawArgs[0];
1515

1616
const docTask = new DocTask({

packages/@angular/cli/commands/eject.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { BuildOptions } from '../models/build-options';
2-
import { Version } from '../upgrade/version';
32
import {baseBuildCommandOptions} from './build';
43

54
const Command = require('../ember-cli/lib/models/command');

packages/@angular/cli/commands/new.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import * as chalk from 'chalk';
21
import InitCommand from './init';
32
import { validateProjectName } from '../utilities/validate-project-name';
43

packages/@angular/cli/commands/serve.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { baseBuildCommandOptions } from './build';
44
import { CliConfig } from '../models/config';
55
import { Version } from '../upgrade/version';
66
import { ServeTaskOptions } from './serve';
7-
import { checkPort } from '../utilities/check-port';
87
import { overrideOptions } from '../utilities/override-options';
98

109
const SilentError = require('silent-error');

packages/@angular/cli/lib/ast-tools/ast-utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function insertAfterLastOccurrence(nodes: ts.Node[], toInsert: string,
8888
}
8989

9090

91-
export function getContentOfKeyLiteral(source: ts.SourceFile, node: ts.Node): string {
91+
export function getContentOfKeyLiteral(_source: ts.SourceFile, node: ts.Node): string {
9292
if (node.kind == ts.SyntaxKind.Identifier) {
9393
return (node as ts.Identifier).text;
9494
} else if (node.kind == ts.SyntaxKind.StringLiteral) {
@@ -101,7 +101,7 @@ export function getContentOfKeyLiteral(source: ts.SourceFile, node: ts.Node): st
101101

102102

103103
function _angularImportsFromNode(node: ts.ImportDeclaration,
104-
sourceFile: ts.SourceFile): {[name: string]: string} {
104+
_sourceFile: ts.SourceFile): {[name: string]: string} {
105105
const ms = node.moduleSpecifier;
106106
let modulePath: string | null = null;
107107
switch (ms.kind) {

packages/@angular/cli/lib/base-href-webpack/base-href-webpack-plugin.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {BaseHrefWebpackPlugin} from './base-href-webpack-plugin';
44

55
function mockCompiler(indexHtml: string, callback: Function) {
66
return {
7-
plugin: function (event: any, compilerCallback: Function) {
7+
plugin: function (_event: any, compilerCallback: Function) {
88
const compilation = {
9-
plugin: function (hook: any, compilationCallback: Function) {
9+
plugin: function (_hook: any, compilationCallback: Function) {
1010
const htmlPluginData = {
1111
html: indexHtml
1212
};
@@ -29,15 +29,15 @@ describe('base href webpack plugin', () => {
2929
it('should do nothing when baseHref is null', () => {
3030
const plugin = new BaseHrefWebpackPlugin({ baseHref: null });
3131

32-
const compiler = mockCompiler(html, (x: any, htmlPluginData: any) => {
32+
const compiler = mockCompiler(html, (_x: any, htmlPluginData: any) => {
3333
expect(htmlPluginData.html).toEqual('<body><head></head></body>');
3434
});
3535
plugin.apply(compiler);
3636
});
3737

3838
it('should insert base tag when not exist', function () {
3939
const plugin = new BaseHrefWebpackPlugin({ baseHref: '/' });
40-
const compiler = mockCompiler(html, (x: any, htmlPluginData: any) => {
40+
const compiler = mockCompiler(html, (_x: any, htmlPluginData: any) => {
4141
expect(htmlPluginData.html).toEqual(oneLineTrim`
4242
<html>
4343
<head><base href="/"></head>
@@ -55,7 +55,7 @@ describe('base href webpack plugin', () => {
5555
const compiler = mockCompiler(oneLineTrim`
5656
<head><base href="/" target="_blank"></head>
5757
<body></body>
58-
`, (x: any, htmlPluginData: any) => {
58+
`, (_x: any, htmlPluginData: any) => {
5959
expect(htmlPluginData.html).toEqual(oneLineTrim`
6060
<head><base href="/myUrl/" target="_blank"></head>
6161
<body></body>

packages/@angular/cli/models/webpack-configs/common.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { BaseHrefWebpackPlugin } from '../../lib/base-href-webpack';
66
import { extraEntryParser, lazyChunksFilter, getOutputHashFormat } from './utils';
77
import { WebpackConfigOptions } from '../webpack-config';
88

9-
const autoprefixer = require('autoprefixer');
109
const ProgressPlugin = require('webpack/lib/ProgressPlugin');
1110
const HtmlWebpackPlugin = require('html-webpack-plugin');
1211

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { WebpackConfigOptions } from '../webpack-config';
22

3-
export const getDevConfig = function (wco: WebpackConfigOptions) {
3+
export const getDevConfig = function (_wco: WebpackConfigOptions) {
44
return {};
55
};

packages/@angular/cli/models/webpack-configs/production.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { WebpackConfigOptions } from '../webpack-config';
99

1010
export const getProdConfig = function (wco: WebpackConfigOptions) {
1111
const { projectRoot, buildOptions, appConfig } = wco;
12-
const appRoot = path.resolve(projectRoot, appConfig.root);
1312

1413
let extraPlugins: any[] = [];
1514
let entryPoints: {[key: string]: string[]} = {};

0 commit comments

Comments
 (0)