-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-line type breakage in 31 #669
Comments
One more I just noticed: /**
* Typedef with multi-line property type.
*
* @typedef {object} MyType
* @property {function(
* number
* )} numberEater Method which takes a number.
*/ now causes:
|
Thanks for the report. I've filed syavorsky/comment-parser#109 as |
Good call. Thanks @brettz9! |
🎉 This issue has been resolved in version 31.0.6 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Many thanks @syavorsky and @brettz9! Unfortunately, I don't believe all the manifestations of this JSDoc are fixed. The |
@brettz9 let me know if there is anything else on the parser's side to be tweaked |
@syavorsky : Sure, thanks... In looking at this one, I see it is being successfully parsed with all of the expected tokens being present, but I would still expect /** Multi-line typedef for an options object type.
*
* @typedef {{
* prop: number
* }} MyOptions
*/ After the default tag and type tokenizers, this is the output: {
tag: 'typedef',
name: '',
type: '{prop: number}',
optional: false,
description: '',
problems: [],
source: [
{ number: 2, source: ' * @typedef {{', tokens: [Object] },
{ number: 3, source: ' * prop: number', tokens: [Object] },
{ number: 4, source: ' * }} MyOptions', tokens: [Object] },
{ number: 5, source: ' */', tokens: [Object] }
]
} ...and this is still the same after the default name tokenizer. (The description tokenzier thinks that |
I see. Let me deal with it quickly |
FWIW, I see this example appears to follow the same pattern: /** Example with multi-line param type.
*
* @param {function(
* number
* )} cb Callback.
*/
function example(cb) {
cb(42);
} Before and after name tokenization: {
tag: 'param',
name: '',
type: 'function(number)',
optional: false,
description: '',
problems: [],
source: [
{
number: 2,
source: ' * @param {function(',
tokens: [Object]
},
{ number: 3, source: ' * number', tokens: [Object] },
{ number: 4, source: ' * )} cb Callback.', tokens: [Object] },
{ number: 5, source: ' */', tokens: [Object] }
]
} |
@brettz9 please try with |
@syavorsky : All looks good, thanks again! |
🎉 This issue has been resolved in version 31.0.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks again @syavorsky and @brettz9! I can confirm that 31.0.7 fixes all the occurrences of this issue that I had encountered. It's working great! |
To ensure we have the fix for gajus/eslint-plugin-jsdoc#669. Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Expected behavior
That tags split across multiple lines would behave as they do in 30.7.13 and before.
Actual behavior
Several rules are triggered when tags span multiple lines of a comment block prefixed with
*
. Examples below.ESLint Config
ESLint sample
Now causes:
Now causes:
Now causes:
There are probably others. I'm not sure what restrictions JSDoc has for splitting tags across multiple lines. For what it's worth, the above examples appear to generate the same output when the lines are joined.
Also, if you'd prefer I open these as separate issues, or do a more thorough search for cases where line splitting behavior changed, let me know.
Thanks again,
Kevin
Environment
eslint-plugin-jsdoc
version: 31.0.3The text was updated successfully, but these errors were encountered: