@types/xxxx package and had problems.Definitions by: in index.d.ts) so they can respond.The addition by @nicojs causes the following errors that were not present in 2.2.1:
(389,30): error TS2304: Cannot find name 'Map'.
(393,28): error TS2304: Cannot find name 'Map'.
(400,30): error TS2304: Cannot find name 'Set'.
(404,28): error TS2304: Cannot find name 'Set'.
reverting to version 2.2.1 removes these errors.
interface Map<v, k> {}
interface Set<T> {}
Why not use the "lib" option in tsconfig.json?
{
"compilerOptions": {
"lib": [
"dom",
"es2015"
],
@aluanhaddad when you're not building a browser app for example
We should add the interfaces. @Jraller do you want to prepare a PR?
I only added "dom" as an example. If you are targeting NodeJS you can still use "lib": ["es2015" to get Set and Map and whatnot.
Ah ok, yeah than that would be better.
Does that mean this version of sinon does not support older versions of node where there is no Map and Set? If no, than we should still add the interfaces.
lib: ["dom"] is not enough if you are targeting es5 if I am not mistaken. Since the types are shimed in Sinon, there should be an interface for them in Sinon IMHO. Unless there is something that I did not get right.
@jraller your suggestion worked for me. I've raised a PR but I get the feeling there might be a deeper issue.
npm install --save-dev @types/es6-collections
Seems to have fixed it.
npm install --save-dev @types/es6-collections`Seems to have fixed it.
Although this is true, i would prefer to use the bundled es6.collections lib. In tsconfig:
"lib": [
"es2015.collection"
]
NB: You might also need other libs, like "es5" and "dom"
Thanks @nicojs. I've got it to work with:
"lib": ["es5", "es2015.collection", "es2015.promise"]
Most helpful comment
Seems to have fixed it.