Skip to content

Commit

Permalink
Fix TypeScript 2.9 build
Browse files Browse the repository at this point in the history
In TypeScript 2.9 the constraint of `keyof T` is now `string | number | symbol`. This is not compatible with the type of the `event` parameter in `EventEmitter` methods, which is `string | symbol`.

The compiler option `--keyofStringsOnly` reverts to TypeScript's old `keyof T` contraint, and has been added to `tsconfig.json` to resolve this breaking change.

More info: microsoft/TypeScript#23724
  • Loading branch information
Kevin Snyder committed Jun 25, 2018
1 parent 779c33d commit 254868f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"rimraf": "^2.6.2",
"sinon": "^5.0.10",
"ts-node": "^6.0.5",
"typescript": "^2.8.3"
"typescript": "^2.9.2"
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"module": "commonjs",
"declaration": true,
"outDir": "./lib",
"strict": true
"strict": true,
"keyofStringsOnly": true
},
"exclude": [
"./lib",
Expand Down

0 comments on commit 254868f

Please sign in to comment.