Hi,
I think there might be a version mismatch between TypeScript versions used locally vs on Exercism, on the TypeScript track.
Context
On the TypeScript track, on the “word-count” exercise, the tests passed locally for me, but when submitted to Exercism, threw an error:
error TS1384: A ‘new’ expression with type arguments must always be followed by a parenthesized argument list.
The issue was the following line in my solution:
const result = new Map<string, number>;
Changing it to the below fixed it:
const result = new Map<string, number>();
Root cause investigation
On the main branch of TypeScript’s source code repo, the error code TS1384
no longer exists in the diagnostic messages file, which suggests it’s been removed at some point.
I’m wondering whether it’s present in the TypeScript version being used by the test runner, but not in the version required when running the tests locally?
I see in the package.json
for the TypeScript exercises, the development dependency version for TypeScript is listed ^4.5.4
, i.e. v4.5.4 and above, whilst TypeScript’s latest version is v4.9.4 (which I’m running locally).