|
1 |
| -import { Command, CommandScope, Option } from '../models/command'; |
| 1 | +import { CommandScope, Option } from '../models/command'; |
| 2 | +import { ArchitectCommand } from '../models/architect-command'; |
2 | 3 |
|
3 |
| -export interface LintCommandOptions { |
4 |
| - fix?: boolean; |
5 |
| - typeCheck?: boolean; |
6 |
| - format?: string; |
7 |
| - force?: boolean; |
| 4 | +export interface RunOptions { |
| 5 | + app?: string; |
| 6 | + configuration?: string; |
8 | 7 | }
|
9 | 8 |
|
10 |
| -export default class LintCommand extends Command { |
| 9 | +export default class LintCommand extends ArchitectCommand { |
11 | 10 | public readonly name = 'lint';
|
| 11 | + public readonly target = 'tslint'; |
12 | 12 | public readonly description = 'Lints code in existing project.';
|
13 | 13 | public static aliases = ['l'];
|
14 | 14 | public readonly scope = CommandScope.inProject;
|
15 |
| - public readonly arguments: string[] = []; |
16 |
| - public readonly options: Option[] = []; |
| 15 | + public readonly arguments: string[] = ['app']; |
| 16 | + public readonly options: Option[] = [ |
| 17 | + this.configurationOption |
| 18 | + ]; |
17 | 19 |
|
18 |
| - public async run(options: LintCommandOptions) { |
19 |
| - const LintTask = require('../tasks/lint').default; |
20 |
| - |
21 |
| - const lintTask = new LintTask({ |
22 |
| - ui: this.ui, |
23 |
| - project: this.project |
| 20 | + public async run(options: RunOptions) { |
| 21 | + const overrides = {...options}; |
| 22 | + delete overrides.app; |
| 23 | + return this.runArchitect({ |
| 24 | + app: options.app, |
| 25 | + configuration: options.configuration, |
| 26 | + overrides |
24 | 27 | });
|
25 |
| - |
26 |
| - return await lintTask.run(options); |
27 | 28 | }
|
28 | 29 | }
|
0 commit comments