You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the package's typings definitions, enzyme typings are being used, but it's not included as a dependency on the package, so if someone doesn't install @types/enzyme manually, a couple of errors appear.
node_modules/enzyme-to-json/index.d.ts:2:59 - error TS7016: Could not find a declaration file for module 'enzyme'. '/node_modules/enzyme/build/index.js' implicitly has an 'any' type.
Try `npm install @types/enzyme` if it exists or add a new declaration (.d.ts) file containing `declare module 'enzyme';`
import {CommonWrapper, ShallowWrapper, ReactWrapper} from 'enzyme';
~~~~~~~~
node_modules/enzyme-to-json/index.d.ts:31:57 - error TS2304: Cannot find name 'Cheerio'.
31 export declare function toJson(wrapper: CommonWrapper | Cheerio, options?: Options): Json;
I know that someone can just install @types/enzyme and the errors are gone, but the correct thing to do is to include the package as a dependency here, as it's being referenced.
The text was updated successfully, but these errors were encountered:
Enzyme is a peerDependency. So we should eventually add @types/enzyme as peerDependency too.
But I never saw a @types package as a dependency. If you're just a javascript user, you don't need it. If you're a typescript it's your responsability to install @types package everytime you install a library.
If someone give me one example where @types are set a dependency/peer-dependency, I'll reconsider the question
On the package's typings definitions,
enzyme
typings are being used, but it's not included as a dependency on the package, so if someone doesn't install@types/enzyme
manually, a couple of errors appear.index.d.ts
Sample errors
I know that someone can just install
@types/enzyme
and the errors are gone, but the correct thing to do is to include the package as a dependency here, as it's being referenced.The text was updated successfully, but these errors were encountered: