microsoft / microsoft/tsdoc

Eliminate API reliance on Object.toString()

Open
#118 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
5k
Forks
162
Avg merge
17h 24m
Merged PRs (30d)
8

Description

Overloading Object.toString() seemed like a sensible way to provide functions for rendering various objects as strings. However, in practice this is confusing because every object has this method, so you never know whether it will actually work or not.

If we used some other method name (e.g. toText()) then IntelliSense would tell you whether there is a converter or not.

See https://github.com/Microsoft/web-build-tools/issues/901 for an example

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

Start by searching the repository for uses of Object.toString() and identify which rendering APIs depend on it. Review the related API definitions and the example in Microsoft/web-build-tools#901 before deciding the replacement scope. Done means the reliance is removed consistently and the affected behavior is covered by the project’s existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, developer-experience
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.