Skip to content

Conversation

TuckerWhitehouse
Copy link
Contributor

#184 added support for auto-fixing the check-tag-names, but it looks like the replacement is on the entire string, and not tag names specifically. This PR is to prefix the replacement with an @ symbol to try and target tag names.

I'm not sure if it would be better to do a global find and replace so all tag names are updated, not just the first match? e.g. new RegExp('@' + jsdocTag.tag, 'g')

I was also looking to add tests, but I didn't see anything for the autofixes - if you have some guidance on how I might go about adding them, I'd be more than happy to.

@TuckerWhitehouse
Copy link
Contributor Author

Sorry, I think this is actually a bug. Give a comment like this:

/**
 * Some description that talks about the return value...

 * @return {Object}
 */

The current behaviour replaces return with returns in the description and leaves the tag name unmodified. Because the tag name is unchanged, the fix will run on every execution and continue to replace return with returns which ends up with something like this:

/**
 * Some description that talks about the returnssssssssssssssss value...

 * @return {Object}
 */

@gajus gajus added bug and removed enhancement labels Apr 19, 2019
@gajus gajus merged commit 4640a35 into gajus:master Apr 19, 2019
@gajus
Copy link
Owner

gajus commented Apr 19, 2019

Thank you for the explanation.

@TuckerWhitehouse TuckerWhitehouse deleted the check-tag-names-replacement branch April 21, 2019 17:45
@gajus
Copy link
Owner

gajus commented May 11, 2019

🎉 This PR is included in version 4.8.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label May 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants