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
require-description with descriptionStyle: body produces "Missing JSDoc block description" when @description is used #608
Comments
I think I have a patch that I'm happy with, but I haven't spent the time to figure out the project's tests and update those. Here's what I've done in if (descriptionStyle === 'body') {
const descTags = _lodash.default.filter(jsdoc.tags,
(tag) => tag.tag == 'desc' || tag.tag == 'description');
if (descTags.length) {
const tagName = descTags[0].tag;
report(`Remove the @${tagName} tag from the block description`);
} else {
report('Missing JSDoc block description.');
}
return;
} Whichever of the two description tags you used, it will tell you explicitly to remove it. What do you think? |
This should be helpful, thanks. Hope to take a look in the next day or so. |
Currently, the /**
* Block style description
* @desc And a tag style description
*/ ...will satisfy any of the conditions and will not be reported. So, I think the message should not instruct the user to remove the `Remove the @${tagName} tag to leave a plain block description or add additional description text above the @${tagName} line.` |
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
… when "body" `descriptionStyle` is set and where user has a desc/description tag; fixes gajus#608
🎉 This issue has been resolved in version 29.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thank you so much for the fix! I appreciate your time and attention. |
Expected behavior
When I set the
descriptionStyle: 'body'
option onjsdoc/require-description
, and my code uses@description
instead of omitting it, I expect to get a message that indicates I should not use that tag.Actual behavior
Instead the error says "Missing JSDoc block description", which I find misleading and unhelpful.
ESLint Config
ESLint sample
Environment
eslint-plugin-jsdoc
version: v29.1.3The text was updated successfully, but these errors were encountered: