Skip to content

Commit 7751064

Browse files
ani3llyonhansl
authored andcommitted
fix(@angular/cli): ng lint option format not work properly if using alias
1 parent aa34b28 commit 7751064

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default Command.extend({
3737
},
3838
{
3939
name: 'format',
40-
alias: 't',
40+
aliases: ['t'],
4141
type: String,
4242
default: 'prose',
4343
description: oneLine`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { ng } from '../../utils/process';
2+
import { writeFile } from '../../utils/fs';
3+
import { getGlobalVariable } from '../../utils/env';
4+
import { oneLine } from 'common-tags';
5+
6+
export default function () {
7+
// Skip this in Appveyor tests.
8+
if (getGlobalVariable('argv').appveyor) {
9+
return Promise.resolve();
10+
}
11+
12+
const fileName = 'src/app/foo.ts';
13+
14+
return Promise.resolve()
15+
.then(() => writeFile(fileName, 'const foo = "";\n'))
16+
.then(() => ng('lint', '-t=stylish', '--force'))
17+
.then(({ stdout }) => {
18+
if (!stdout.match(/1:13 quotemark " should be '/)) {
19+
throw new Error(oneLine`
20+
Expected to match "1:13 quotemark " should be '"
21+
in ${stdout}.
22+
`);
23+
}
24+
});
25+
}

0 commit comments

Comments
 (0)