JSDoc typedef in a separate file

前端 未结 4 1584
萌比男神i
萌比男神i 2020-12-25 11:49

Can I define all custom types in a separate file (e.g. types.jsdoc), so that they can be reused throughout the application? What\'s the right way to do it?

4条回答
  •  北海茫月
    2020-12-25 12:33

    I usually do something similar in my projects, the difference being I use the extension .js to name the file. Webstorm works perfectly and is able to check types and auto-complete just fine. It won't recognize the .jsdoc extension (I just checked), so stick to .js even if the file doesn't contain any code statement.

提交回复
热议问题