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

fix(lint): Suppress global type clash between Jest and Cypress #282

Merged
merged 1 commit into from
Jan 24, 2019

Conversation

markdalgleish
Copy link
Member

@markdalgleish markdalgleish commented Jan 24, 2019

Cypress installs global type definitions for Mocha which clash with Jest's globals, which means that sku lint fails for any consumer that also depends on Cypress.

Unfortunately, due to the nature of globals (😞), there's no easy way to solve the underlying issue, but a workaround is to enable the skipLibCheck flag on the TypeScript compiler (https://github.com/Microsoft/TypeScript-wiki/blob/master/What's-new-in-TypeScript.md#new---skiplibcheck).

When applying this workaround, the global types for Jest are still resolved correctly in *.test.tsx / *.test.tsx files. If consumers want to use TypeScript in their Cypress tests, they'll likely need to provide a custom tsconfig.json in their Cypress subdirectory.

Copy link
Contributor

@kosanna kosanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗜 👏

@kosanna
Copy link
Contributor

kosanna commented Jan 24, 2019

Maybe worth mentioning in the readme?

@markdalgleish markdalgleish merged commit 3a316d7 into master Jan 24, 2019
@markdalgleish markdalgleish deleted the fix-cypress-type-clash branch January 24, 2019 05:49
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

Successfully merging this pull request may close these issues.

3 participants