-
Notifications
You must be signed in to change notification settings - Fork 715
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
Use JSDoc comments for plugin typings #798
Comments
I totally agree. I used to do TypeScript. Now I just write ES6 with JSDoc comments. Good enough for type safety, intellisense, code completion and refactoring. Let me know with you need help with the JSDoc part. Type casting is probably the most tricky part, and create proper custom types. |
Thanks @rbiggs, may be after the major release. I am actually in a rush against a couple other deadlines right now. Another challenge is that I currently maintain most of the JavaScript in CoffeeScript, still using coffeescript@1 to compile to JavaScript (without comments) which is also committed. I will probably transition to coffeescript@2 which keeps the comments among other things. I think there are multiple alternative approaches to dealing with CoffeeScript which I would like to investigate when I get some more time, input and feedback would definitely be appreciated. FYI I have a few additional ideas for preactjs/preact#1161, PR on your fork coming soon. |
prettier/prettier#6286 seems to show how Prettier is adding TypeScript support without even adding a |
An updated about my own issues using JSDoc for types. For a long time I was noticing that when using JSDoc for type information on a JavaScript module, upon importing VSCode and TypeScript showed no type information for the imported module. Recently I discovered why. I was using a {
"compilerOptions": {
"target": "es6",
"jsx": "react"
},
"exclude": [
"node_modules"
]
} A long time ago the TypeScript team had recommended that. But when you do that with modules using JSDoc for types, those types get ignored by TypeScript. Removing that |
Hey bodybits, I noticed that TypeScript was failing to import JSDoc types defined in other files of imported modules. Major bummer for my @composi/core project. I filed a bug with the TypeScript team about it and its now being tracked as a bug in the backlog. Hopefully that means this will get resolved in the next release? Here's the link to the issue: microsoft/TypeScript#33136 (comment) |
Thanks @rbiggs, looks like a good find. |
This is my last nitpick. Modules with types imported from other files that comprise the module should be properly interpreted when you import that module into a new project to use. This works fine inside the module itself. If they can fix this, I feel like I have all my bases covered with JSDoc comments for TypeScript linting. |
Hi @rbiggs, thanks for all of your feedback on this. Considering that I have already started with a redesign, as discussed in #862, I think we should discuss this subject somewhere else. P.S. I raised composi/core#5 to get this subject better documented in general. |
instead of TypeScript as proposed in #657 (see also #768)
got this idea from: preactjs/preact#1161
It would be ideal to include this in July/August 2018 major release (#773) but I don't expect this to be realistic. Maybe for another new release as tracked in #687.
References:
The text was updated successfully, but these errors were encountered: