Skip to content

Commit 1f8ec52

Browse files
authored
Merge branch 'next' into feature/vue
2 parents 39c9012 + 3aef85c commit 1f8ec52

File tree

6 files changed

+248
-209
lines changed

6 files changed

+248
-209
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ deploy:
44
55
skip_cleanup: true
66
api_key:
7-
secure: RdoLwtLDz3PI8fhTg0wXeRuL9JAffNJSTJvNExk9Q+fcccBl8yaNU4AId5OcuDwO3pnb59nKv8fIidW9VzemZ8/eCqCBbCx4qzGFxN2uCB+aBwQ7Svu6GAJV0JIEgIXG+dkByRawd9hCIyvi6IvhIA/XbVbboV5ngjwSW317SA0lbznGHQmIT4o93+YpUuT+pkGC04eJGIH6cgAe61QGwN6WyGx8hfJ+K+OCksZ5A4RIeSkRHY4zRgmlGGtSwOutUPh3OMIdG40E0UXLn3MRdANzekMFSowMZ8aFliqhDsgk/zk8IC/X6OlPFSTAmO1IkKqZiJsr1rxmeJvC9GDxvRZ3Vyv3GncoteEQVjKFsYRlTvmEouECSxafl2aOqa1i2TqU8if5GjgB6mm+pTjDTzF4KB3QkEtRKgTuB47+EUc5zXIBrgIAb3sWu+QgaSFOreG49cGccCsU0viLe2WHbjzuNUP3IMO0x9tL/rm0RQmP3FjQSWlDg6VXYjJs5UcpiQLabgL3u4tso9aYprqTKihqfQkyfi0R5qH872ncGlASkzwbcZxiUeWau3yx46iZdckPNTAKw0afeodmr7aL6B+xEWHfZv9OBn0UE5I23jvIlI+wzyWHWUgeVikBx1ZZV4OqAHOTdEMHQivbir4eYGGAYtY6yxzLpyfD4g0xIzM=
7+
secure: L1iiDkvSgk7uIhdeglWijy8GqSQ63Uu7F/3TB1LEJN2xQ0YgbrBBW2Y1WFzBuVncaLzGV7YtS4eSGT1tjTqEl/c2I4vMdlsusFMSRuA3vDOYc0Uqwn3cjT1X23Exv0foj/Ifltv0idn21TVFWKNy3RSpf1IZ1ZyX9PTBn1QCeUpmlPm5f9HRMOrV7jBPOxS3eS7eeuZvzMk+EsA1XwLhJIhasd0gGXDnItLnCGN+7hrrGEppOQCQhKFfv3cA5hScLSoYUtHwGxryddyhia+UyOfcliXtfb2lvuzJ6rJjRrW6Gce33m1MEXYpOAqkCoF5BXrCLhEfCN+MkfaF9hd8Ytj3DEbIwetcj4XH7rPaiIjN9yKBYkOWeUPUeQ9HRbJ3Nwvapn6od3bHfRr0qCGlltEOtBcMKkARBWd3CiMEJolgoZ1q+w25DZYi9D76jBf8m8MDf2rAt2RapSnBpn70wkPWrcw/+vj/Y5ZQJDj6hzyk/sGTVNOemwtBDa/ishJKVugEQgW+F3mdqoFAfMZrg40yPgj3X34RRUgtTPDGSRZ5+Q57Mt61vcSkNmJWS/oU2zJyHiZEsz0mKOyjko4bip/zkc7oP81GONQ/+EESWuBJusF2ypG/6FJChfgz3XS18jzSRvtihUqLbN30Mvt2mkCeh7GxChVNJVyclCM5HKE=
88
on:
99
tags: true
1010
branch: master

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.2.10
2+
* Fix #80 "Cannot read property 'getLineAndCharacterOfPosition' of undefined"
3+
* Fix #76 "TypeError: Cannot read property '0' of undefined"
4+
15
## v0.2.9
26
* Make errors formatting closer to `ts-loader` style
37
* Handle tslint exclude option

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fork-ts-checker-webpack-plugin",
3-
"version": "0.2.9",
3+
"version": "0.2.10",
44
"description": "Runs typescript type checker and linter on separate process.",
55
"main": "lib/index.js",
66
"files": [

src/NormalizedMessage.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,24 @@ class NormalizedMessage {
4444
// message types
4545
static createFromDiagnostic(diagnostic: tsTypes.Diagnostic) {
4646
const ts: typeof tsTypes = require('typescript');
47-
const position = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
47+
let file: string;
48+
let line: number;
49+
let character: number;
50+
if (diagnostic.file) {
51+
file = diagnostic.file.fileName;
52+
const position = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
53+
line = position.line + 1;
54+
character = position.character + 1;
55+
}
4856

4957
return new NormalizedMessage({
5058
type: NormalizedMessage.TYPE_DIAGNOSTIC,
5159
code: diagnostic.code,
5260
severity: ts.DiagnosticCategory[diagnostic.category].toLowerCase() as Severity,
5361
content: ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'),
54-
file: diagnostic.file.fileName,
55-
line: position.line + 1,
56-
character: position.character + 1
62+
file: file,
63+
line: line,
64+
character: character
5765
});
5866
}
5967

src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ class ForkTsCheckerWebpackPlugin {
423423
}
424424

425425
createEmitCallback(compilation: any, callback: () => void) {
426-
const emitCallback = () => {
426+
return function emitCallback (this: ForkTsCheckerWebpackPlugin) {
427427
const elapsed = Math.round(this.elapsed[0] * 1E9 + this.elapsed[1]);
428428

429429
this.compiler.applyPlugins(
@@ -457,8 +457,6 @@ class ForkTsCheckerWebpackPlugin {
457457

458458
callback();
459459
};
460-
461-
return emitCallback;
462460
}
463461

464462
createNoopEmitCallback() {
@@ -467,7 +465,7 @@ class ForkTsCheckerWebpackPlugin {
467465
}
468466

469467
createDoneCallback() {
470-
const doneCallback = () => {
468+
return function doneCallback (this: ForkTsCheckerWebpackPlugin) {
471469
const elapsed = Math.round(this.elapsed[0] * 1E9 + this.elapsed[1]);
472470

473471
if (this.compiler) {
@@ -499,7 +497,6 @@ class ForkTsCheckerWebpackPlugin {
499497
this.logger.info('Time: ' + this.colors.bold(Math.round(elapsed / 1E6).toString()) + 'ms');
500498
}
501499
};
502-
return doneCallback;
503500
}
504501
}
505502

0 commit comments

Comments
 (0)