Skip to content

Commit cd1c0a4

Browse files
committed
Fix option error print and prepare release 2.6.2
1 parent c828534 commit cd1c0a4

File tree

7 files changed

+56
-7
lines changed

7 files changed

+56
-7
lines changed

dist/commonjs/checker.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/commonjs/checker.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/commonjs/test.js

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/commonjs/test.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fuse-box-typechecker",
3-
"version": "2.6.1",
3+
"version": "2.6.2",
44
"description": "Fuse-Box type checker plugin",
55
"keywords": [
66
"fuse-box-bundler",

src/checker.ts

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { IInternalTypeCheckerOptions, END_LINE, ITSLintError, ITSError } from '.
88
const entries: any = require('object.entries');
99

1010
if (!Object.entries) {
11-
entries.shim();
11+
entries.shim();
1212
}
1313

1414

@@ -208,6 +208,43 @@ export class Checker {
208208
print(allErrors.join(END_LINE));
209209
}
210210

211+
// print option errors
212+
if (program.getOptionsDiagnostics().length) {
213+
print(chalk.underline(`${END_LINE}${END_LINE}Option errors`) + chalk.white(`:${END_LINE}`));
214+
let optionErrorsText = Object.entries(program.getOptionsDiagnostics())
215+
.map(([no, err]) => {
216+
let text = no + ':';
217+
text = chalk[options.yellowOnOptions ? 'yellow' : 'red']
218+
(`└── tsConfig: `);
219+
text += chalk.white(`(${(<any>err).category}:`);
220+
text += chalk.white(`${(<any>err).code})`);
221+
text += chalk.white(` ${(<any>err).messageText}`);
222+
return text;
223+
});
224+
print(optionErrorsText.join(END_LINE));
225+
}
226+
227+
// print global errors
228+
// todo: this needs testing, how do I create a global error??
229+
/* try {
230+
if (program.getGlobalDiagnostics().length) {
231+
print(chalk.underline(`${END_LINE}${END_LINE}Global errors`) + chalk.white(`:${END_LINE}`));
232+
let optionErrorsText = Object.entries(program.getGlobalDiagnostics())
233+
.map(([no, err]) => {
234+
let text = no + ':';
235+
text = chalk[options.yellowOnGlobal ? 'yellow' : 'red']
236+
(`└── tsConfig: `);
237+
text += chalk.white(`(${(<any>err).category}:`);
238+
text += chalk.white(`${(<any>err).code})`);
239+
text += chalk.white(` ${(<any>err).messageText}`);
240+
return text;
241+
});
242+
print(optionErrorsText.join(END_LINE));
243+
}
244+
} catch (err) {
245+
console.log(`Global error`);
246+
} */
247+
211248
// time for summary >>>>>
212249

213250
// get errors totals

0 commit comments

Comments
 (0)