Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move @types/sinon to prod dependencies #22

Closed
claabs opened this issue May 17, 2021 · 1 comment
Closed

Move @types/sinon to prod dependencies #22

claabs opened this issue May 17, 2021 · 1 comment

Comments

@claabs
Copy link

claabs commented May 17, 2021

Building with Typescript on a project that doesn't already use sinon throws this error:

node_modules/aws-sdk-client-mock/dist/types/awsClientStub.d.ts:2:41 - error TS7016: Could not find a declaration file for module 'sinon'. '<my-project>/node_modules/sinon/lib/sinon.js' implicitly has an 'any' type.
  Try `npm install @types/sinon` if it exists or add a new declaration (.d.ts) file containing `declare module 'sinon';`

2 import { SinonSpyCall, SinonStub } from 'sinon';
                                          ~~~~~~~

The Typescript handbook recommends that any exported type that has a dependency on a package should be in the dependencies rather than devDependencies. Moving @types/sinon to the dependencies would solve this issue.

m-radzikowski added a commit that referenced this issue May 31, 2021
* chore: bump sinon to v11 (fixes #24)

* fix: move sinon types to prod dependencies (fixes #22)
@m-radzikowski
Copy link
Owner

Thank you for the link to the docs, didn't know about it. Should be OK now in v0.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants