-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript code collections #1121
Comments
I can't believe this has been avoided/delayed for so long - first class typescript support should be the standard now. Especially to avoid things like this: if ('data' in command && 'execute' in command) {
commands.push(command.data.toJSON());
} else {
console.log(
`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`
);
} |
There's nothing wrong with this, nor should it be avoided in JavaScript code. We are also going to support TypeScript though |
@monbrey I'm saying that JavaScript code should be avoided, by pushing TS as the primary/recommended way of doing things in the docs. That way nobody needs to worry about checking for key names on arbitrary objects. I get that it can be seen as personal preference, but ultimately the docs should be recommending best practices and type safety, and giving the option for JS. Not the other way around. |
JS is a valid programming language, and often the default for beginners. It is not easy to wrap your head around types when you are starting out, which a large portion of our user base is. |
Is your feature request related to a problem? Please describe.
Some concepts covered in the guide require more attention when using typescript.
Describe the solution you'd like
Toplevel code block collection (above files/in navbar setting) to provide both js and ts code samples
Describe alternatives you've considered
Use the current code block collection element to cover typescript versions of code samples
Additional notes
n/a
The text was updated successfully, but these errors were encountered: