Build: Fix JSDoc syntax errors#9813
Build: Fix JSDoc syntax errors#9813not-an-aardvark merged 2 commits intoeslint:masterfrom silvenon:jsdoc
Conversation
|
I'm not sure why my commit message is invalid. 😄 |
|
I think you have to have a colon ( |
JSDoc syntax errors were causing "npm run docs" to fail. - JSDoc doesn't yet support specifying array content, i.e. "[number, number]" is a syntax error, so I'm using "number[]" instead. (source: jsdoc/jsdoc#1073) - JSDoc doesn't support multiline objects, e.g. returning report information was a syntax error, so I extracted it into a typedef, as well as the disable directive.
|
@j-f1 lol, yeah, I added the colon at the wrong place. Now it works, yay. 🎉 |
platinumazure
left a comment
There was a problem hiding this comment.
LGTM, thanks! Just left a couple of questions.
| * @property {(number|undefined)} endColumn | ||
| * @property {(string|null)} nodeType | ||
| * @property {string} source | ||
| * @property {({text: string, range: (number[]|null)}|null)} fix |
There was a problem hiding this comment.
Wondering if this should be extracted to a typedef? It's a bit gnarly.
There was a problem hiding this comment.
@property {Fix|null} fix maybe?
| * @param {Fix[]} fixes The fixes to merge. | ||
| * @param {SourceCode} sourceCode The source code object to get the text between fixes. | ||
| * @returns {{text: string, range: [number, number]}} The merged fixes | ||
| * @returns {{text: string, range: number[]}} The merged fixes |
There was a problem hiding this comment.
Not familiar with JSDoc. Can we do something like number[2] or otherwise represent the ranges as a 2-tuple somehow?
There was a problem hiding this comment.
Unfortunately it doesn't work, and I haven't found any details about specifying the length of the array on the internet. I don't think JSDoc supports it.
|
Thanks for contributing! |
What is the purpose of this pull request? (put an "X" next to item)
docsscript which was failing due to JSDoc syntax errors.What changes did you make? (Give an overview)
I fixed the
docsscript that was failing due to JSDoc syntax errors.JSDoc doesn't yet support specifying array content, i.e. "[number,
number]" is a syntax error, so I'm using "number[]" instead. (source:
How to document array elements? jsdoc/jsdoc#1073)
JSDoc doesn't support multiline objects, e.g. returning report information
was a syntax error, so I extracted it into a typedef, as well as the
disable directive.
Is there anything you'd like reviewers to focus on?
@typedefs, which now show up in the docs. Is that acceptable or should I inline them?[number, number]syntax isn't a valid way to describe arrays, so I had to turn it intonumber[], which is less descriptive. I could perhaps extract it into a separate typedef and add a description, but it sounds like an overkill.