Conversation
|
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
83a1bb2 to
80c2171
Compare
|
The TypeScript team hasn't accepted the linked issue #27387. If you can get it accepted, this PR will have a better chance of being reviewed. |
Please no. That isn't consistent with how any other type comments are parsed, the extra edge case doesn't just affect TS. |
Fixes #27387
This is an implementation proposal for
@specializeJSDoc tag, which will allow specifying type arguments in JS files. For example iffhas a type parameterT, the following JSDoc syntax:will be equivalent to TS:
The tag can be also attached to any other parent node, e.g. assignment statement would also do:
Currently, it is also possible to wrap type arguments with
<...>as in/** @specialize <number> */,if that's the preference. I couldn't make up my mind so I allowed both options for now.
The following expressions are also supported:
I am still planning to add more unit tests, e.g.
Having said that, I've decided to open this PR early (as draft), because there are some open questions where I seek your advice:
@specializea good name for this tag? I was also considering@typeArgs, which I think would be a little bit cleaner in communicating its purpose, but I don't like the fact that it consists of two words, as so far there has been no precedence.@specializeis the fact that some people would prefer to spell it "specialise" and I am worried that it may cause confusion and typing errors in the future.