Skip to content
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

User Typescript without .ts file directly in js #26992

Closed
chiqui3d opened this issue Sep 10, 2018 · 2 comments
Closed

User Typescript without .ts file directly in js #26992

chiqui3d opened this issue Sep 10, 2018 · 2 comments
Labels
Question An issue which isn't directly actionable in code

Comments

@chiqui3d
Copy link

I like to follow a pattern in programming languages and I would like to start using the typing of functions and variables in Javascript, but I do not understand why they force to use a different extension like .ts, is there any way to do it directly in .js?

@AlCalzone
Copy link
Contributor

First of all: This question is better asked on StackOverflow. This is a bug tracker, not a support forum (as you read when creating this request)

Second: You can use JSDoc comments in plain JavaScript to assert the types of your methods and variables and just let TypeScript check those (for example by using VSCode as an editor). This is limited compared to full TypeScript but goes a long way already.

@ghost ghost added the Question An issue which isn't directly actionable in code label Sep 10, 2018
@joeytwiddle
Copy link

This isn't possible right now, but people have been asking for it, so maybe one day... #9694

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question An issue which isn't directly actionable in code
Projects
None yet
Development

No branches or pull requests

4 participants