discordjs / guide

The official guide for discord.js, created and maintained by core members of its community.
https://discordjs.guide
MIT License
1.57k stars 2.3k forks source link

feat/typescript: add TypeScript examples to the guide #1560

Open omar-sobhy opened 6 months ago

omar-sobhy commented 6 months ago

Please describe the changes this PR makes and why it should be merged:

WIP WIP! I'm only opening the PR to get opinions on the current structure and suggestions on how to improve things. The current examples are slightly opinionated, but could possibly stand to be more opinionated on things like the tsconfig.json.

This PR adds TypeScript examples to the guide.

Pages now have TypeScript markdown containers when TypeScript-specific tips need to be displayed. Additionally, TypeScript examples are added to pages using code groups so that guide readers can switch between JS/TS examples on the fly.

Closes #1121

omar-sobhy commented 6 months ago

Something I was considering is creating an entirely separate TypeScript section in the guide and adding all the guide content there. This has the advantage of keeping the JS portion of the guide clean, but it also essentially duplicates the content

ghost commented 6 months ago

Maybe eslint section should also include basic information about typescript-eslint too.