Skip to content

Commit 77f2dfd

Browse files
committed
refactor: additional lint fixes
1 parent 796a51e commit 77f2dfd

24 files changed

+63
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"test:messages": "node scripts/test-commit-messages.js",
2424
"test:packages": "node scripts/run-packages-spec.js",
2525
"eslint": "eslint .",
26-
"tslint": "tslint \"**/*.ts\" -c tslint.json -e \"**/config/schema.d.ts\" -e \"**/tests/**\" -e \"node_modules/**\" -e \"tmp/**\" -e \"dist/**\"",
26+
"tslint": "tslint \"**/*.ts\" -c tslint.json -e \"**/config/schema.d.ts\" -e \"**/tests/**\" -e \"node_modules/**\" -e \"tmp/**\" -e \"dist/**\" -e \"tools/**\"",
2727
"lint": "npm-run-all -c eslint tslint",
2828
"tool": "node scripts/run-tool.js"
2929
},

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable:no-any
12
import { tags, terminal } from '@angular-devkit/core';
23
import { NodePackageDoesNotSupportSchematics } from '@angular-devkit/schematics/tools';
34
import { CommandScope, Option } from '../models/command';

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default class BuildCommand extends ArchitectCommand {
1818
// Check Angular and TypeScript versions.
1919
Version.assertCompatibleAngularVersion(this.project.root);
2020
Version.assertTypescriptVersion(this.project.root);
21+
2122
return super.validate(options);
2223
}
2324

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ function setValueFromPath<T extends JsonArray | JsonObject>(
105105
value[current] = {};
106106
}
107107
}
108+
108109
return value[current];
109110
} else if (typeof current == 'number' && Array.isArray(value)) {
110111
if (index === fragments.length - 1) {
@@ -116,6 +117,7 @@ function setValueFromPath<T extends JsonArray | JsonObject>(
116117
value[current] = {};
117118
}
118119
}
120+
119121
return value[current];
120122
} else {
121123
return undefined;
@@ -211,7 +213,12 @@ export default class ConfigCommand extends Command {
211213
}
212214

213215
private get(config: experimental.workspace.WorkspaceSchema, options: ConfigOptions) {
214-
const value = options.jsonPath ? getValueFromPath(config as any, options.jsonPath) : config;
216+
let value;
217+
if (options.jsonPath) {
218+
value = getValueFromPath(config as {} as JsonObject, options.jsonPath);
219+
} else {
220+
value = config;
221+
}
215222

216223
if (value === undefined) {
217224
this.logger.error('Value cannot be found.');

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default class DocCommand extends Command {
2424
public validate(options: Options) {
2525
if (!options.keyword) {
2626
this.logger.error(`keyword argument is required.`);
27+
2728
return false;
2829
}
2930
}

packages/@angular/cli/commands/easter-egg.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class AwesomeCommand extends Command {
1212
readonly arguments: string[] = [];
1313
readonly options: Option[] = [];
1414

15-
run(_options: any) {
15+
run() {
1616
const phrase = pickOne([
1717
`You're on it, there's nothing for me to do!`,
1818
`Let's take a look... nope, it's all good!`,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable:no-any
12
import { tags, terminal } from '@angular-devkit/core';
23
import { CommandScope, Option } from '../models/command';
34
import { SchematicCommand } from '../models/schematic-command';

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable:no-any
12
import { terminal } from '@angular-devkit/core';
23
import { Command, Option } from '../models/command';
34

@@ -13,6 +14,7 @@ export default class HelpCommand extends Command {
1314
.map(key => {
1415
const Cmd = options.commandMap[key];
1516
const command: Command = new Cmd(null, null);
17+
1618
return command;
1719
})
1820
.filter(cmd => !cmd.hidden && !cmd.unknown)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// tslint:disable:no-any
12
import { CommandScope, Option } from '../models/command';
23
import { SchematicCommand } from '../models/schematic-command';
34
import { getDefaultSchematicCollection } from '../utilities/config';
@@ -93,6 +94,7 @@ export default class NewCommand extends SchematicCommand {
9394
const opts = Object.assign({}, options);
9495
delete opts.verbose;
9596
delete opts.collection;
97+
9698
return opts;
9799
}
98100
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default class ServeCommand extends ArchitectCommand {
1818
// Check Angular and TypeScript versions.
1919
Version.assertCompatibleAngularVersion(this.project.root);
2020
Version.assertTypescriptVersion(this.project.root);
21+
2122
return true;
2223
}
2324

0 commit comments

Comments
 (0)