DEV Community

Discussion on: TypeScript Might Not Be Your God: Case Study of Migration from TS to JSDoc

Collapse
 
what1s1ove profile image
Vladyslav Zubko • Edited

Hey @trusktr ! Thank you for your answer and advice!

I knew about auto-import when the type is declared via JSDoc comments and also about the new @import feature (I followed and contributed to the discussion on this feature here). However, I prefer the type declaration using let + JSDoc comments, as shown in the screenshots above. The main issue with using comments is that there are no ESLint rules to lint them. It's easy to forget to delete something because rules like "no-unused-vars" or "sorted-imports" don't work for type declarations and imports in JSDoc comments.

The issue about annotations as comments is really good! I wasn't aware of it. I've subscribed to it and will follow all the discussions. Thank you!