Skip to content

Commit d47ca49

Browse files
committed
Use this.ui.write instead of console.log.
1 parent 77dcac0 commit d47ca49

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

index.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
/* eslint-env node */
2-
3-
'use strict';
4-
var path = require('path');
5-
var process = require('process');
2+
const path = require('path');
63

74
let TsPreprocessor;
85
try {
96
TsPreprocessor = require('./lib/typescript-preprocessor');
10-
} catch ( ex ) {
7+
} catch (ex) {
118
// Do nothing; we just won't have the plugin available. This means that if you
129
// somehow end up in a state where it doesn't load, the preprocessor *will*
1310
// fail, but this is necessary because the preprocessor depends on packages
@@ -17,30 +14,33 @@ try {
1714
module.exports = {
1815
name: 'ember-cli-typescript',
1916

20-
21-
included: function(app) {
17+
included(app) {
2218
this._super.included.apply(this, arguments);
2319
this.app = app;
24-
2520
},
2621

27-
blueprintsPath: function() {
22+
blueprintsPath() {
2823
return path.join(__dirname, 'blueprints');
2924
},
3025

3126
setupPreprocessorRegistry: function(type, registry) {
3227
if (!TsPreprocessor) {
33-
console.log("Note: TypeScript preprocessor not available -- some dependencies not installed. (If this is during installation of the add-on, this is as expected. If it is while building, serving, or testing the application, this is an error.)");
28+
this.ui.write(
29+
'Note: TypeScript preprocessor not available -- some dependencies not installed. ' +
30+
'(If this is during installation of the add-on, this is as expected. If it is ' +
31+
'while building, serving, or testing the application, this is an error.)'
32+
);
3433
return;
3534
}
3635

3736
try {
38-
var plugin = new TsPreprocessor({includeExtensions: ['.ts','.js']});
37+
const plugin = new TsPreprocessor({ includeExtensions: ['.ts', '.js'] });
3938
registry.add('js', plugin);
40-
} catch ( ex ) {
41-
console.log( "Missing or invalid tsconfig.json, please fix or run `ember generate ember-cli-typescript`." );
42-
console.log( ' ' + ex.toString());
39+
} catch (ex) {
40+
this.ui.write(
41+
'Missing or invalid tsconfig.json, please fix or run `ember generate ember-cli-typescript`.'
42+
);
43+
this.ui.write(' ' + ex.toString());
4344
}
44-
}
45-
45+
},
4646
};

0 commit comments

Comments
 (0)