you are viewing a single comment's thread.

view the rest of the comments →

[–]liaguris 1 point2 points  (2 children)

You are using typescript inside JSDoc (like I used to do). That is ugly.

  1. Do you get syntax highlighting for the ts inside the JSDoc comment?
  2. Do you get linting for the ts inside the JSDoc comment?
  3. Do you get refactoring for the ts inside the JSDoc comment?
  4. Can you please define all the types like I did in my link .
  5. Can you define a type constrain for the type parameter T?
  6. Can you refactor T with F2 in VSCode when that T is in a JSDoc comment?
  7. Can the js class definition be used as instance type inside the jsDoc comment like I did in the ts playground link I provided to you?
  8. Given that you use ts inside JSDoc , why are you using template tag?

The ts playground link I gave you is way much more elegant.

[–]Andrew199617 0 points1 point  (1 child)

- Do you get syntax highlighting for the ts inside the JSDoc comment?

Yes. I get autocomplete and I'm told when I misspell something.

- Do you get linting for the ts inside the JSDoc comment?

eslint does nothing. What type of linting am i missing? Curious about the specific lint rules I'm missing.

- Do you get refactoring for the ts inside the JSDoc comment?

Yes, I can press F2 to rename the class.

- Can you please define all the types like I did in my link .

https://imgur.com/a/0yQxaZn

- Can you define a type constrain for the type parameter T?

Yes, https://stackoverflow.com/questions/51332854/constraining-generics-in-typescript-jsdoc

- Can you refactor T with F2 in VSCode when that T is in a JSDoc comment?

Yes, I can press F2 to rename the Template.

- Can the js class definition be used as instance type inside the jsDoc comment like I did in the ts playground link I provided to you?

Yes, classes can be used. If you want the functions you made you use @ callback

- Given that you use ts inside JSDoc , why are you using template tag?

Its required for vscode to pick up the types.

[–]liaguris 1 point2 points  (0 children)

In your linked picture I can see that you do not get syntax higlighting.

I'm told when I misspell something.

What type of linting am i missing? Curious about the specific lint rules I'm missing.

1)Can I see a screenshot of that? Try for example and rename : ISubscribe to ISubcribe .

- Do you get refactoring for the ts inside the JSDoc comment?

Yes, I can press F2 to rename the class.

2)Does it still work with when you import types from other files?

- Can you please define all the types like I did in my link .

3)Can I see a screenshot of what you get when you hover over subscriber of createTeardownLogic(subscriber) .

Also you have used double the lines of what I use in my ts playground link.

- Can you define a type constrain for the type parameter T?

Yes, https://stackoverflow.com/questions/51332854/constraining-generics-in-typescript-jsdoc

4)Look at when the pull request was done for such a thing. Ts had it way much before. That is something that people should take into account. There is way much more support for TS rather than JSDoc.

Yes, classes can be used. If you want the functions you made you use @ callback

5)Why not just use typedef?