Uh oh!
There was an error while loading. Please reload this page.
tools/doc: improvements for types - #11167
Conversation
TimothyGu
commented
Feb 4, 2017
The first commit LGTM. For the second, I would prefer a more generic syntax like |
I actually prefer primitives to stay lowercase. Can't we just fix the parser? Also on an unrelated note, in the particular example you showed, the inline 'pem' property description should actually have |
silverwind
commented
Feb 4, 2017
I don't have stats, but I estimate that > 80% of our types are currently capitalized.
That'd be quite hard to parse. It's not following the type convention of |
mscdex
commented
Feb 5, 2017
I'm not suggesting it should parse it necessarily, I'm mostly just pointing out a typo that should be corrected. |
There was a problem hiding this comment.
Can we merge this if...else chain with the previous one on line 57?
So on current master we have 571 occurences in docs with capitalized primitive types and 160 without. I could change those all to lowercase as suggested by @mscdex. MDN currently lists them capitalized and the |
thefourtheye
commented
Feb 5, 2017
I would consider this as a problem. |
Updated:
Example: @nodejs/documentation PTAL. |
sam-github
commented
Feb 14, 2017
Consistency sounds great to me. Is the example in #11167 (comment) what it looks like now? How come |
silverwind
commented
Feb 14, 2017
Because |
TimothyGu
commented
Feb 14, 2017
@silverwind, have you seen my comment above? |
silverwind
commented
Feb 14, 2017
Yes, I think |
silverwind
commented
Feb 15, 2017
sam-github
commented
Feb 16, 2017
Not so sure that's a useful distinction that we need to convey to our doc readers, given that strings do have methods in practical cases, but at least its something we can point to in our docs, and say we are following jsdoc. Did you mean to write |
BTW flow and TypeScript are using lower-cased primitive types too(therefore used by definitely typed, where a lot of people get their types from in their tools nowadays even if they don't use TypeScript) |
TimothyGu
commented
Feb 27, 2017
FWIW, Tern also uses lowercased primitive types. |
thefourtheye
commented
Feb 27, 2017
My mind is trained to understand a name as a constructor function if it starts with a capital letter. So I am going to go with lowercase names. |
silverwind
commented
Feb 27, 2017
I think we are in agreement that lowercase primitives is the way to go. Can I get a few LGTMs? I'll rebase and land shortly after it's approved. |
PR-URL: #11167 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
MylesBorins
commented
May 15, 2017
ping |
silverwind
commented
May 16, 2017
Backport in #13054 |
PR-URL: nodejs#11167 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#11167 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#11167 Backport-PR-URL: nodejs#13054 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#11167 Backport-PR-URL: nodejs#13054 Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>

Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
The first commit capitalizes all primitive types so the parser can pick them up.
The second commit adds logic to the doctool to allow parsing of
Type[]array syntax.Before
After