react-component / react-component/tree

Seeing type issue with latest upgrade for estree types

Open
#770 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
490
Avg merge
3d 17h
Merged PRs (30d)
5

Description

I'm getting the error below when I'm upgrading types in my antd implementation:

-        "@types/estree": "^1.0.1",
+        "@types/estree": "^1.0.4",

There seems to be a typing issue with the latest library

node_modules/antd/node_modules/rc-tree/lib/interface.d.ts:59:70 - error TS2344: Type 'DateType' does not satisfy the constraint 'BasicDataNode'.

59 export type KeyEntities<DateType = any> = Record<SafeKey, DataEntity<DateType>>;
                                                                        ~~~~~~~~

  node_modules/antd/node_modules/rc-tree/lib/interface.d.ts:59:25
    59 export type KeyEntities<DateType = any> = Record<SafeKey, DataEntity<DateType>>;
                               ~~~~~~~~~~~~~~
    This type parameter might need an `extends BasicDataNode` constraint.

BasicDataNode is a type from estree

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the reported upgrade from @types/estree ^1.0.1 to ^1.0.4 in an antd implementation and inspect node_modules/antd/node_modules/rc-tree/lib/interface.d.ts at the KeyEntities type. Compare the installed type definitions and confirm the issue is resolved when the TypeScript check completes without the BasicDataNode constraint error.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.