Apply suggestions from code review

Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
This commit is contained in:
Arthur Baars
2022-12-19 14:16:05 +01:00
committed by GitHub
parent 06736e3e91
commit 682bf6d3a7

View File

@@ -6,15 +6,15 @@
*/
private import codeql.suppression.AlertSuppression as AS
private import semmle.javascript.Locations as L
private import javascript as JS
class SingleLineComment extends L::Locatable {
private string text;
SingleLineComment() {
(
text = this.(L::Comment).getText() or
text = this.(L::HTML::CommentNode).getText()
text = this.(JS::Comment).getText() or
text = this.(JS::HTML::CommentNode).getText()
) and
// suppression comments must be single-line
not text.matches("%\n%")