Skip to content

Commit 326c7af

Browse files
committed
JS: Fix incorrect classification of Vue files
1 parent e00a8f7 commit 326c7af

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

javascript/ql/src/filters/ClassifyFiles.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ predicate classify(File f, string category) {
8080
or
8181
// Polymer templates
8282
exists(HTML::Element elt | elt.getName() = "template" |
83-
f = elt.getFile() and category = "template"
83+
f = elt.getFile() and
84+
category = "template" and
85+
not f.getExtension() = "vue"
8486
)
8587
}

javascript/ql/src/semmle/javascript/GeneratedCode.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,10 @@ private int countStartingHtmlElements(File f, int l) {
164164
/**
165165
* Holds if the base name of `f` is a number followed by a single extension.
166166
*/
167-
predicate isGeneratedFileName(File f) { f.getStem().regexpMatch("[0-9]+") }
167+
predicate isGeneratedFileName(File f) {
168+
f.getStem().regexpMatch("[0-9]+") and
169+
not f.getExtension() = "vue"
170+
}
168171

169172
/**
170173
* Holds if `tl` looks like it contains generated code.

0 commit comments

Comments
 (0)