Skip to content

Commit 05588fc

Browse files
committed
refactor: clean up unused code and imports
1 parent 065520d commit 05588fc

35 files changed

Lines changed: 34 additions & 90 deletions

File tree

lib/packages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import * as path from 'path';
1414
import * as ts from 'typescript';
1515

1616
const distRoot = path.join(__dirname, '../dist');
17-
const { versions: monorepoVersions, packages: monorepoPackages } = require('../.monorepo.json');
17+
const { packages: monorepoPackages } = require('../.monorepo.json');
1818

1919

2020
export interface PackageInfo {

packages/angular/cli/commands/analytics-impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
2929
return 1;
3030
} else {
3131
// No argument were passed.
32-
await this.printHelp(options);
32+
await this.printHelp();
3333

3434
return 2;
3535
}
@@ -70,7 +70,7 @@ export class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
7070
break;
7171

7272
default:
73-
await this.printHelp(options);
73+
await this.printHelp();
7474

7575
return 3;
7676
}
@@ -81,7 +81,7 @@ export class AnalyticsCommand extends Command<AnalyticsCommandSchema> {
8181
break;
8282

8383
default:
84-
await this.printHelp(options);
84+
await this.printHelp();
8585

8686
return 4;
8787
}

packages/angular/cli/commands/config-impl.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ function _validateBoolean(value: string) {
3737
throw new Error(`Invalid value type; expected Boolean, received ${JSON.stringify(value)}.`);
3838
}
3939
}
40-
function _validateNumber(value: string) {
41-
const numberValue = Number(value);
42-
if (!Number.isFinite(numberValue)) {
43-
return numberValue;
44-
}
45-
throw new Error(`Invalid value type; expected Number, received ${JSON.stringify(value)}.`);
46-
}
4740
function _validateString(value: string) {
4841
return value;
4942
}

packages/angular/cli/commands/generate-impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export class GenerateCommand extends SchematicCommand<GenerateCommandSchema> {
6161

6262
public async run(options: GenerateCommandSchema & Arguments) {
6363
if (!this.schematicName || !this.collectionName) {
64-
return this.printHelp(options);
64+
return this.printHelp();
6565
}
6666

6767
return this.runSchematic({
@@ -105,8 +105,8 @@ export class GenerateCommand extends SchematicCommand<GenerateCommandSchema> {
105105
return [collectionName, schematicName];
106106
}
107107

108-
public async printHelp(options: GenerateCommandSchema & Arguments) {
109-
await super.printHelp(options);
108+
public async printHelp() {
109+
await super.printHelp();
110110

111111
this.logger.info('');
112112
// Find the generate subcommand.

packages/angular/cli/models/architect-command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ export abstract class ArchitectCommand<
193193
return await this.runArchitectTarget(options);
194194
}
195195

196-
protected async runBepTarget<T>(
196+
protected async runBepTarget(
197197
command: string,
198198
configuration: Target,
199199
overrides: json.JsonObject,

packages/angular/cli/models/command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
4949
return;
5050
}
5151

52-
async printHelp(options: T & Arguments): Promise<number> {
52+
async printHelp(): Promise<number> {
5353
await this.printHelpUsage();
5454
await this.printHelpOptions();
5555

@@ -175,7 +175,7 @@ export abstract class Command<T extends BaseCommandOptions = BaseCommandOptions>
175175
await this.initialize(options);
176176

177177
if (options.help === true) {
178-
return this.printHelp(options);
178+
return this.printHelp();
179179
} else if (options.help === 'json' || options.help === 'JSON') {
180180
return this.printJsonHelp(options);
181181
} else {

packages/angular/cli/models/schematic-command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ export abstract class SchematicCommand<
110110
}
111111
}
112112

113-
public async printHelp(options: T & Arguments) {
114-
await super.printHelp(options);
113+
public async printHelp() {
114+
await super.printHelp();
115115
this.logger.info('');
116116

117117
const subCommandOption = this.description.options.filter(x => x.subcommands)[0];

packages/angular_devkit/architect/src/schedule-by-name.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
import { analytics, experimental, json, logging } from '@angular-devkit/core';
99
import { EMPTY, Subscription } from 'rxjs';
10-
import { catchError, first, ignoreElements, map, share, shareReplay, tap } from 'rxjs/operators';
10+
import { catchError, first, ignoreElements, map, shareReplay } from 'rxjs/operators';
1111
import {
1212
BuilderInfo,
1313
BuilderInput,

packages/angular_devkit/benchmark/src/default-stats-capture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import { Observable } from 'rxjs';
1010
import { map, reduce } from 'rxjs/operators';
11-
import { AggregatedProcessStats, Capture, MetricGroup, MonitoredProcess } from './interfaces';
11+
import { AggregatedProcessStats, Capture, MetricGroup } from './interfaces';
1212
import { cumulativeMovingAverage, max } from './utils';
1313

1414

packages/angular_devkit/build_angular/plugins/webpack/analytics.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export class NgBuildAnalyticsPlugin {
122122

123123
return metrics;
124124
}
125-
protected _getDimensions(stats: Stats) {
125+
protected _getDimensions() {
126126
const dimensions: (string | number | boolean)[] = [];
127127

128128
if (this._stats.errors.length) {
@@ -136,13 +136,13 @@ export class NgBuildAnalyticsPlugin {
136136
}
137137

138138
protected _reportBuildMetrics(stats: Stats) {
139-
const dimensions = this._getDimensions(stats);
139+
const dimensions = this._getDimensions();
140140
const metrics = this._getMetrics(stats);
141141
this._analytics.event(this._category, 'build', { dimensions, metrics });
142142
}
143143

144144
protected _reportRebuildMetrics(stats: Stats) {
145-
const dimensions = this._getDimensions(stats);
145+
const dimensions = this._getDimensions();
146146
const metrics = this._getMetrics(stats);
147147
this._analytics.event(this._category, 'rebuild', { dimensions, metrics });
148148
}

0 commit comments

Comments
 (0)