Open cieniawska opened 1 year ago
I can reproduce with examples/typescript/
in this repository by upgrading the typescript
dependency to a 5.x release. It looks like the extensions to the Enzyme types in https://github.com/preactjs/enzyme-adapter-preact-pure/blob/master/index.d.ts, which are included in the package, are not being seen by TS any more.
For examples/typescript/
I was able to work around this by manually copying the types into the local project:
cd examples/typescript/
npm install typescript@latest
cp node_modules/enzyme-adapter-preact-pure/index.d.ts enzyme-extensions.d.ts
npm test
I am not sure of the proper fix for this in TS 5.0 offhand. If anyone knows, feel free to chime in.
hello, is there anything else we could do about it? 🤔
Also waiting for update
A possible workaround for this is to reference "enzyme-adapter-preact-pure/index.d.ts"
in your tsconfig.json compilerOptions.types
setting.
{
"compilerOptions": {
// ...
"types": ["enzyme-adapter-preact-pure/index.d.ts"],
},
// ...
}
I would have assumed that adding a reference as /// <reference types="enzyme-adapter-preact-pure/index.d.ts" />
should also work, but it doesn't.
The good thing about referencing the types from within the tsconfig file, is that you no longer need to add /// <reference types="enzyme-adapter-preact-pure" />
anywhere.
Hello,
after upgrading to
typescript v5.2.2
I'm facing some issues with your package.I'm using:
Can you please assist?