fent / fent/node-ytdl-core

[proposal] Migrate to TypeScript

Open
#870 8 comments 0 reactions 0 assignees View on GitHub
discussion feature
Dominant language
JavaScript
Stars
4.7k
Forks
852
PR merge metrics
No merged PRs in 30d

Description

## Why?

I don't know how about other IDEs but it seems that VSCode would show JSDoc hints only if they are declared in TypeScript part (in `.d.ts`). For example VSCode wouldn't show [description for `getVideoID`](https://github.com/fent/node-ytdl-core/blob/e14c9da91fbb383e8cc84fc6dab2febd13ee277d/lib/url-utils.js#L51-L52).
I don't think it's a big inconvenience for everyone but again we could provide a better developer experience with this change 🚀 .

AFAIK TypeScript doesn't have disadvantages and I think it would be much easier to keep everything in one place.

For instance
```ts
export const getVideoID = (str: string): string => {
// ...
```

@fent Do you have any thoughts on this?
and do you mind if I show you how it could be done?

P.S. Sorry if I misspelled anything

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing lib/url-utils.js, especially getVideoID and its JSDoc, then compare the current JavaScript structure with the proposed .d.ts and TypeScript example. The issue does not name the full migration scope or tests; done would require an agreed project-wide TypeScript migration with equivalent behavior and improved VSCode hints.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript
Domain
developer-experience, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.