forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlint.ts
More file actions
23 lines (21 loc) · 630 Bytes
/
lint.ts
File metadata and controls
23 lines (21 loc) · 630 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as Promise from 'ember-cli/lib/ext/promise';
import * as Task from 'ember-cli/lib/models/task';
import * as chalk from 'chalk';
import {exec} from 'child_process';
module.exports = Task.extend({
run: function () {
var ui = this.ui;
return new Promise(function(resolve, reject) {
exec('npm run lint', (err, stdout) => {
ui.writeLine(stdout);
if (err) {
ui.writeLine(chalk.red('Lint errors found in the listed files.'));
reject();
} else {
ui.writeLine(chalk.green('All files pass linting.'));
resolve();
}
});
});
}
});