DefinitelyTyped / DefinitelyTyped/DefinitelyTyped

[fabric] Do not overwrite native `Object` type

Open
#64,651 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
51.4k
Forks
30.4k
Avg merge
3d 21h
Merged PRs (30d)
108

Description

Fabric type definition overwrites native Object constructor, which makes Typescript autocomplete to suggest all properties defined in Fabric's Object type when destructuring (See the screenshot)

Incorrect IDE autocompletion

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/85754720ec0e51d48dc28a3e7230a327899e79af/types/fabric/fabric-impl.d.ts#L3189

Removing this line in my local environment makes the IDE not to suggest incorrect properties anymore - that's because the global Object constructor doesn't get merged with the one from Fabric's implementation.

Can you please remove this?

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

Open types/fabric/fabric-impl.d.ts at line 3189 and inspect the Fabric declaration that overwrites the native Object constructor. Remove that declaration, then verify that TypeScript autocomplete no longer suggests Fabric Object properties when destructuring and that the definition remains valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.