JS: Fix incorrect classification of Vue files

This commit is contained in:
Asger Feldthaus
2020-06-29 15:49:07 +01:00
parent e00a8f7670
commit 326c7af4eb
2 changed files with 7 additions and 2 deletions

View File

@@ -80,6 +80,8 @@ predicate classify(File f, string category) {
or
// Polymer templates
exists(HTML::Element elt | elt.getName() = "template" |
f = elt.getFile() and category = "template"
f = elt.getFile() and
category = "template" and
not f.getExtension() = "vue"
)
}

View File

@@ -164,7 +164,10 @@ private int countStartingHtmlElements(File f, int l) {
/**
* Holds if the base name of `f` is a number followed by a single extension.
*/
predicate isGeneratedFileName(File f) { f.getStem().regexpMatch("[0-9]+") }
predicate isGeneratedFileName(File f) {
f.getStem().regexpMatch("[0-9]+") and
not f.getExtension() = "vue"
}
/**
* Holds if `tl` looks like it contains generated code.