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

add TypeScript definition to task.js #544

Merged
merged 2 commits into from
Aug 2, 2023
Merged

add TypeScript definition to task.js #544

merged 2 commits into from
Aug 2, 2023

Conversation

quisido
Copy link
Contributor

@quisido quisido commented Jan 8, 2022

Fixes error in IDE:

image

Fixes error in CI:

/.../cypress/plugins/index.ts
  13:3  error  Unsafe call of an `any` typed value  @typescript-eslint/no-unsafe-call

Workaround

I've been copy-pasting this between repos, which is a poor developer experience, but it's also now not working in monorepos, because it's existence in the root directory is not picked up by the workspace-specific linter.

declare module '@cypress/code-coverage/task' {
  import 'cypress';
  export default function registerCodeCoverageTasks(
    on: Cypress.PluginEvents,
    // eslint-disable-next-line @typescript-eslint/prefer-readonly-parameter-types
    config: Cypress.PluginConfigOptions,
  ): void;
}

The aim of this PR is to apply the workaround solution to this repository such that the workaround is no longer required.

@CLAassistant
Copy link

CLAassistant commented Jan 8, 2022

CLA assistant check
All committers have signed the CLA.

@quisido
Copy link
Contributor Author

quisido commented Jul 31, 2023

Sorry to ping directly @lmiller1990 and @cacieprins but since you reviewed the last PR and this PR also has not been reviewed in >1 year, please give it a look. This TypeScript incompatibility blocks all validation of Cypress code coverage (which is important when combining multiple plugins) and linters that prevent the use of any.

@jordanpowell88
Copy link
Contributor

@CharlesStover this is no longer an issue in Cypress 10+ AFAIK. Can you provide an example of this in a newer version of Cypress?

@lmiller1990
Copy link
Contributor

Still an error @jordanpowell88
image

Let's approve and merge this

Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Thanks, sorry to keep you waiting for a year

Please ping me if you need 👀 on anything

@jordanpowell88 jordanpowell88 merged commit d51fe12 into cypress-io:master Aug 2, 2023
1 check passed
@quisido quisido deleted the patch-1 branch August 2, 2023 23:49
@cypress-app-bot
Copy link

🎉 This PR is included in version 3.12.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@filipomar
Copy link

I added another PR tangential to this issue, as I don't think the type is 100% correct.
Also, I stumbled upon this issue, which I think can be closed due to it already being resolved.

@cypress-io cypress-io locked and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants