no-warning-comments to match on whole words only #1709
The no-warning-comments rule just does an indexOf check to find the specified terms in the comments, which means it matches on parts of words. This isn't such a problem for terms such as "todo", "fixme", etc, but if you want to use other words in there, then you can get a lot of false positives. For example, the term "he" is found in "the". Surrounding the term with spaces doesn't help either, since it might be followed by punctuation.
My proposal: change the check to use word boundaries around each of the terms. In essence, this would make this change:
commentText.toLowerCase().indexOf('term'); // becomes /\bterm\b/i.test(commentText);