Skip to content

Commit c2560b4

Browse files
filipesilvahansl
authored andcommitted
fix(lint): fix listing of files (#417)
1 parent e88f1c5 commit c2560b4

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed

addon/ng2/commands/lint.js renamed to addon/ng2/commands/lint.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
/* jshint node: true */
2-
'use strict';
3-
4-
var Command = require('ember-cli/lib/models/command');
5-
var LintTask = require('../tasks/lint');
1+
import * as Command from 'ember-cli/lib/models/command';
2+
import * as LintTask from '../tasks/lint';
63

74
module.exports = Command.extend({
85
name: 'lint',

addon/ng2/tasks/lint.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

addon/ng2/tasks/lint.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as Promise from 'ember-cli/lib/ext/promise';
2+
import * as Task from 'ember-cli/lib/models/task';
3+
import * as chalk from 'chalk';
4+
import {exec} from 'child_process';
5+
6+
module.exports = Task.extend({
7+
run: function () {
8+
var ui = this.ui;
9+
10+
return new Promise(function(resolve) {
11+
exec('npm run lint', (err, stdout) => {
12+
ui.writeLine(stdout);
13+
if (err) {
14+
ui.writeLine(chalk.red('Lint errors found in the listed files.'));
15+
} else {
16+
ui.writeLine(chalk.green('All files pass linting.'));
17+
}
18+
resolve();
19+
});
20+
});
21+
}
22+
});

0 commit comments

Comments
 (0)