mirror of
https://github.com/github/codeql.git
synced 2026-04-27 01:35:13 +02:00
Javascript: Autoformat qls
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import javascript
|
||||
|
||||
|
||||
from HTML::ScriptElement e
|
||||
select e, e.getScript()
|
||||
select e, e.getScript()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import javascript
|
||||
|
||||
abstract class Violation extends ASTNode { abstract string reason(); }
|
||||
abstract class Violation extends ASTNode {
|
||||
abstract string reason();
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds for tuples of form `[X, "name1"]` where `X` is a simple type access
|
||||
|
||||
@@ -10,9 +10,7 @@ string getTokenStringAtLine(File file, int line) {
|
||||
result = concat(Token tok |
|
||||
tok = getATokenAtLine(file, line)
|
||||
|
|
||||
tok.toString().replaceAll(" ", "~") + " "
|
||||
order by
|
||||
tok.getLocation().getStartColumn()
|
||||
tok.toString().replaceAll(" ", "~") + " " order by tok.getLocation().getStartColumn()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import javascript
|
||||
|
||||
abstract class Violation extends ASTNode { abstract string reason(); }
|
||||
abstract class Violation extends ASTNode {
|
||||
abstract string reason();
|
||||
}
|
||||
|
||||
class MissingContainer extends Violation, TypeExpr {
|
||||
MissingContainer() { not exists(getContainer()) }
|
||||
|
||||
@@ -3,7 +3,10 @@ import javascript
|
||||
string getKind(ImportTypeExpr imprt) {
|
||||
if imprt.isTypeAccess()
|
||||
then result = "type"
|
||||
else if imprt.isNamespaceAccess() then result = "namespace" else result = "value"
|
||||
else
|
||||
if imprt.isNamespaceAccess()
|
||||
then result = "namespace"
|
||||
else result = "value"
|
||||
}
|
||||
|
||||
from ImportTypeExpr imprt
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import javascript
|
||||
|
||||
select any(Vue::Instance i)
|
||||
select any(Vue::Instance i)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from Vue::Instance i, string name
|
||||
select i, name, i.getAPropertyValue(name)
|
||||
select i, name, i.getAPropertyValue(name)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import javascript
|
||||
|
||||
from Vue::Instance i, string name
|
||||
select i, name, i.getOption(name)
|
||||
select i, name, i.getOption(name)
|
||||
|
||||
Reference in New Issue
Block a user