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

[plotly.js] Fix TS2430 error with exactOptionalPropertyTypes #69621

Conversation

andersk
Copy link
Contributor

@andersk andersk commented May 16, 2024

An automated change #54346 that was intended to fix errors with exactOptionalPropertyTypes actually introduced an error with exactOptionalPropertyTypes here. Fix it.

$ echo 'import "plotly.js"' > test.ts
$ tsc --strict --exactOptionalPropertyTypes test.ts
node_modules/@types/plotly.js/index.d.ts:120:18 - error TS2430: Interface 'PlotRelayoutEvent' incorrectly extends interface 'Partial<Layout>'.
  Types of property '"xaxis.range[0]"' are incompatible.
    Type 'number | undefined' is not assignable to type 'Datum'.
      Type 'undefined' is not assignable to type 'Datum'.

120 export interface PlotRelayoutEvent extends Partial<Layout> {
                     ~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/@types/plotly.js/index.d.ts:120

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

    $ echo 'import "plotly.js"' > test.ts
    $ tsc --strict --exactOptionalPropertyTypes test.ts
    node_modules/@types/plotly.js/index.d.ts:120:18 - error TS2430: Interface 'PlotRelayoutEvent' incorrectly extends interface 'Partial<Layout>'.
      Types of property '"xaxis.range[0]"' are incompatible.
        Type 'number | undefined' is not assignable to type 'Datum'.
          Type 'undefined' is not assignable to type 'Datum'.

    120 export interface PlotRelayoutEvent extends Partial<Layout> {
                         ~~~~~~~~~~~~~~~~~

    Found 1 error in node_modules/@types/plotly.js/index.d.ts:120

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
@typescript-bot
Copy link
Contributor

typescript-bot commented May 16, 2024

@andersk Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

This PR can be merged once it's reviewed.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • ✅ Most recent commit is approved by type definition owners or DT maintainers

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 69621,
  "author": "andersk",
  "headCommitOid": "b4077201b1bcdfc337ed53d49e7489ad184d2e7c",
  "mergeBaseOid": "1bba57575cd1fc07e67147b89872cffa0684f35b",
  "lastPushDate": "2024-05-16T03:02:27.000Z",
  "lastActivityDate": "2024-06-04T21:49:29.000Z",
  "maintainerBlessed": "Waiting for Code Reviews",
  "mergeOfferDate": "2024-06-04T20:55:13.000Z",
  "mergeRequestDate": "2024-06-04T21:49:29.000Z",
  "mergeRequestUser": "andersk",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Popular",
  "pkgInfo": [
    {
      "name": "plotly.js",
      "kind": "edit",
      "files": [
        {
          "path": "types/plotly.js/index.d.ts",
          "kind": "definition"
        }
      ],
      "owners": [
        "chrisgervang",
        "martinduparc",
        "frederikaalund",
        "taoqf",
        "Dadstart",
        "szechyjs",
        "soorajpudiyadath",
        "jonfreedman",
        "meganrm",
        "milesjos",
        "skippercool",
        "mtadams007",
        "marnett-git",
        "peterblazejewicz",
        "brammitch",
        "blizzardjessica",
        "olegshilov",
        "PabloGracia",
        "jvgogh",
        "jpabdou"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    }
  ],
  "reviews": [
    {
      "type": "approved",
      "reviewer": "peterblazejewicz",
      "date": "2024-06-04T20:54:36.000Z",
      "isMaintainer": true
    }
  ],
  "mainBotCommentID": 2113926492,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Popular package This PR affects a popular package (as counted by NPM download counts). Untested Change This PR does not touch tests labels May 16, 2024
@typescript-bot
Copy link
Contributor

Hey @andersk,

😒 Your PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Please consider adding tests to cover the change you're making. Including tests allows this PR to be merged by yourself and the owners of this module.

This can potentially save days of time for you!

@typescript-bot typescript-bot added this to Waiting for Code Reviews in New Pull Request Status Board May 16, 2024
@typescript-bot
Copy link
Contributor

🔔 @chrisgervang @martinduparc @frederikaalund @taoqf @Dadstart @szechyjs @soorajpudiyadath @jonfreedman @meganrm @milesjos @SkipperCool @mtadams007 @marnett-git @peterblazejewicz @brammitch @blizzardjessica @olegshilov @PabloGracia @jvgogh @jpabdou — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Review in New Pull Request Status Board May 16, 2024
andersk added a commit to andersk/zulip that referenced this pull request May 16, 2024
Submitted upstream:
DefinitelyTyped/DefinitelyTyped#69621

Signed-off-by: Anders Kaseorg <anders@zulip.com>
timabbott pushed a commit to zulip/zulip that referenced this pull request May 16, 2024
@typescript-bot
Copy link
Contributor

Re-ping @chrisgervang, @martinduparc, @frederikaalund, @taoqf, @Dadstart, @szechyjs, @soorajpudiyadath, @jonfreedman, @meganrm, @milesjos, @SkipperCool, @mtadams007, @marnett-git, @peterblazejewicz, @brammitch, @blizzardjessica, @olegshilov, @PabloGracia, @jvgogh, @jpabdou:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label May 27, 2024
@sheetalkamat sheetalkamat moved this from Needs Maintainer Review to Waiting for Code Reviews in New Pull Request Status Board May 28, 2024
@typescript-bot
Copy link
Contributor

It has been more than two weeks and this PR still has no reviews.

I'll bump it to the DT maintainer queue. Thank you for your patience, @andersk.

(Ping @chrisgervang, @martinduparc, @frederikaalund, @taoqf, @Dadstart, @szechyjs, @soorajpudiyadath, @jonfreedman, @meganrm, @milesjos, @SkipperCool, @mtadams007, @marnett-git, @peterblazejewicz, @brammitch, @blizzardjessica, @olegshilov, @PabloGracia, @jvgogh, @jpabdou.)

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in New Pull Request Status Board Jun 3, 2024
Copy link
Member

@peterblazejewicz peterblazejewicz left a comment

Choose a reason for hiding this comment

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

LGTM!
The change is 3 years old, it could be other part of DT module changed in the meantime

@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels Jun 4, 2024
@typescript-bot
Copy link
Contributor

@andersk: Everything looks good here. I am ready to merge this PR (at b407720) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@chrisgervang, @martinduparc, @frederikaalund, @taoqf, @Dadstart, @szechyjs, @soorajpudiyadath, @jonfreedman, @meganrm, @milesjos, @SkipperCool, @mtadams007, @marnett-git, @peterblazejewicz, @brammitch, @blizzardjessica, @olegshilov, @PabloGracia, @jvgogh, @jpabdou: you can do this too.)

@typescript-bot typescript-bot moved this from Needs Maintainer Action to Waiting for Author to Merge in New Pull Request Status Board Jun 4, 2024
@andersk
Copy link
Contributor Author

andersk commented Jun 4, 2024

Ready to merge

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in New Pull Request Status Board Jun 4, 2024
@typescript-bot typescript-bot merged commit 2268337 into DefinitelyTyped:master Jun 4, 2024
4 checks passed
@andersk andersk deleted the plotly-exactOptionalPropertyTypes branch June 4, 2024 21:50
@typescript-bot typescript-bot removed this from Recently Merged in New Pull Request Status Board Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintainer Approved Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner Untested Change This PR does not touch tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants