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

TypeScriptify reporter. #5666

Merged
merged 64 commits into from
Nov 27, 2019
Merged

Conversation

sainthkh
Copy link
Contributor

@sainthkh sainthkh commented Nov 12, 2019

Part of #2690
Preparation for #678

Notes

  • Couldn't TypeScriptify integration tests because currently webpack config files are all typescript files. plugins/index.js cannot parse them.

PR Tasks

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Nov 12, 2019

Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.

  • Please write [WIP] in the title of your Pull Request if your PR is not ready for review - someone will review your PR as soon as the [WIP] is removed.
  • Please familiarize yourself with the PR Review Checklist and feel free to make updates on your PR based on these guidelines.

PR Review Checklist

If any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'.

User Experience

  • The feature/bugfix is self-documenting from within the product.
  • The change provides the end user with a way to fix their problem (no dead ends).

Functionality

  • The code works and performs its intended function with the correct logic.
  • Performance has been factored in (for example, the code cleans up after itself to not cause memory leaks).
  • The code guards against edge cases and invalid input and has tests to cover it.

Maintainability

  • The code is readable (too many nested 'if's are a bad sign).
  • Names used for variables, methods, etc, clearly describe their function.
  • The code is easy to understood and there are relevant comments explaining.
  • New algorithms are documented in the code with link(s) to external docs (flowcharts, w3c, chrome, firefox).
  • There are comments containing link(s) to the addressed issue (in tests and code).

Quality

  • The change does not reimplement code.
  • There's not a module from the ecosystem that should be used instead.
  • There is no redundant or duplicate code.
  • There are no irrelevant comments left in the code.
  • Tests are testing the code’s intended functionality in the best way possible.

Internal

  • The original issue has been tagged with a release in ZenHub.

@sainthkh sainthkh changed the title wip TypeScriptify reporter. TypeScriptify reporter. Nov 18, 2019
@sainthkh sainthkh marked this pull request as ready for review November 18, 2019 06:50
@sainthkh
Copy link
Contributor Author

It seems that the failure was because of a flaky test.

@jennifer-shehane jennifer-shehane requested a review from a team November 18, 2019 23:13
@dmtrKovalenko
Copy link
Contributor

LGTM. Overall, there are some problems in the overall codebase, but they are coming from previous source. 👍

dmtrKovalenko
dmtrKovalenko previously approved these changes Nov 20, 2019
@@ -3,9 +3,23 @@
"plugin:@cypress/dev/react",
"plugin:@cypress/dev/tests"
],
"parser": "@typescript-eslint/parser",
Copy link
Contributor

Choose a reason for hiding this comment

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

good to know we don't need parser: babel-eslint. If this works, after this gets merged we can update https://github.com/cypress-io/eslint-plugin-dev/blob/master/lib/index.js#L308 and remove babel-eslint

kuceb
kuceb previously approved these changes Nov 20, 2019
Copy link
Contributor

@kuceb kuceb left a comment

Choose a reason for hiding this comment

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

@sainthkh you have outdone yourself here, this is great. There are a few files that got renamed and had enough changes to where they show up as deleted/added instead of renamed, but I don't think it's a big deal.

  • I still need to pull this down and run it locally

@sainthkh sainthkh dismissed stale reviews from kuceb and dmtrKovalenko via a64f7ee November 21, 2019 07:59
@sainthkh
Copy link
Contributor Author

sainthkh commented Nov 21, 2019

Fixed a few type errors. It seems that we need a type check process in our CI. Maybe we need another PR for this.

+ Another failure caused by flaky test.

Copy link
Contributor

@chrisbreiding chrisbreiding left a comment

Choose a reason for hiding this comment

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

I see now that eslint's no-unused-vars is superceded by TypeScript's, so that's why it has to be turned off, because it marks type declarations as unused vars.

packages/reporter/src/.eslintrc.json Show resolved Hide resolved
packages/reporter/src/.eslintrc.json Outdated Show resolved Hide resolved
@chrisbreiding chrisbreiding merged commit 0311c58 into cypress-io:develop Nov 27, 2019
avallete pushed a commit to avallete/cypress that referenced this pull request Nov 28, 2019
* Turn on strict mode for ts files.

* Tsified lib/app-state.

* Tsified lib/err-model

* Fixed eslint setting for tsx files.

* Installed typings for classnames, chai-enzyme.

* Tsified header/controls.jsx. Fixed app-state.ts for it.

* Changed parser to typescript-eslint.

* Tsified header/stats-store

* Turn off no-unused-vars because it is checked by typescript compiler.

* Removed Omit because we use typescript parser for eslint.

* Tsified header/stats

* Created Props interfaces.

* Tsified header/header

* Tsified hooks/hook-model

* Tsified routes/route-model

* Tsified lib/util

* Tsified collapsible/collapsible

* Tsified lib/flash-on-click

* Tsified instrument-model and agent.

* Tsified command/command-model.ts

* Made hook-model use command-model types.

* Tsified runnable/runnable-model and suite-model

* Tsified lib/scroller.

* Tsified test/test-model.

* Tsified runnable-store and fixed related files.

* Tsified shortcuts

* Renamed events.ts

* Tsified lib/events

* Added typings

* Tsified command/command.tsx.

* Added more types to command.tsx

* Tsified AnError and TestError

* Tsified Hooks.

* Tsified Routes.

* Tsified test.tsx.

* Tsified runnable-and-suite.tsx.

* Tsified runnables.tsx

* Added react-dom types.

* Tsified main.jsx.

* Fixed for build.

* Fixed "Definition was not found" error.

* Fixed sinon name imports.

* Fixed Agents test types.

* Removed IAppState.

* Renamed for clarity.

* Fixed model type in test-error.

* Removed IStatsStore

* Fixed HookModel.

* Removed !. in events.

* Fixed RouteModel.

* Fixed runnables-store.

* Fixed TestModel-related things.

* Removed anys.

* Fixed lint error.

* Fixed AppState.pinnedSnapshotId type.

* Fixed more types.

* Removed NodeJS.TimeOut.

* Fixed unit test failures.

* fix lint script

* used warn instead of 1
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.

None yet

5 participants