Skip to content

Commit

Permalink
fix(@angular/cli): ng lint option format not work properly if using…
Browse files Browse the repository at this point in the history
… alias
  • Loading branch information
ani3llyon authored and hansl committed Aug 23, 2017
1 parent da98c7c commit 11723e9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/@angular/cli/commands/lint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default Command.extend({
},
{
name: 'format',
alias: 't',
aliases: ['t'],
type: String,
default: 'prose',
description: oneLine`
Expand Down
25 changes: 25 additions & 0 deletions tests/e2e/tests/lint/lint-with-format-by-aliases.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { ng } from '../../utils/process';
import { writeFile } from '../../utils/fs';
import { getGlobalVariable } from '../../utils/env';
import { oneLine } from 'common-tags';

export default function () {
// Skip this in Appveyor tests.
if (getGlobalVariable('argv').appveyor) {
return Promise.resolve();
}

const fileName = 'src/app/foo.ts';

return Promise.resolve()
.then(() => writeFile(fileName, 'const foo = "";\n'))
.then(() => ng('lint', '-t=stylish', '--force'))
.then(({ stdout }) => {
if (!stdout.match(/1:13 quotemark " should be '/)) {
throw new Error(oneLine`
Expected to match "1:13 quotemark " should be '"
in ${stdout}.
`);
}
});
}

0 comments on commit 11723e9

Please sign in to comment.