-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Improve detection in hide-useless-comments
#3827
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
Improve detection in hide-useless-comments
#3827
Conversation
|
Thanks! It’s worth adding a comment about the skin modifiers. Also what do you think about: if (text.replace(everykeyword, '').trim() === '') {
return
}This should cover repetition without complicating the regex, and also avoid multiple regexes. It’d be also great to add some tests for this function |
|
@fregante: Building on your idea, how about: if (text.replace(everykeyword, '').trim().length < 20) {
return
}This would catch a lot of small variations (e.g. justinfrankel/licecap#97 (comment), justinfrankel/licecap#97 (comment)) very easily. Ofc |
|
It's best to leave some comments visible than risk hiding useful comments; the comment needs to be a "perfect match" for us to be sure that it can be hidden. For this reason I'd adjust the regex to only specifically hide |
fregante
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
@cheap-glitch keep up your great work. Wanted to give you a shout out on your super clear first posts! |
Thanks for contributing! 🍄
LINKED ISSUES: Closes Add more keywords to
hide-useless-comments#3822TEST URLS:
This PR:
TODO:
text.replace()