mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
patch upper-case acronyms to be PascalCase
This commit is contained in:
@@ -20,7 +20,7 @@ import javascript
|
||||
* A comparison construct, that is, either an equality test or a switch case
|
||||
* (which is implicitly compared to the switch statement's discriminant).
|
||||
*/
|
||||
class EqOrSwitch extends ASTNode {
|
||||
class EqOrSwitch extends AstNode {
|
||||
EqOrSwitch() {
|
||||
this instanceof EqualityTest or
|
||||
this instanceof Case
|
||||
|
||||
@@ -18,7 +18,7 @@ import javascript
|
||||
* Holds if `nd` is a use of deprecated language feature `type`, and `replacement`
|
||||
* is the recommended replacement.
|
||||
*/
|
||||
predicate deprecated_feature(ASTNode nd, string type, string replacement) {
|
||||
predicate deprecated_feature(AstNode nd, string type, string replacement) {
|
||||
exists(FunctionExpr fe | fe = nd and fe.getBody() instanceof Expr |
|
||||
type = "expression closures" and replacement = "arrow expressions"
|
||||
)
|
||||
@@ -38,6 +38,6 @@ predicate deprecated_feature(ASTNode nd, string type, string replacement) {
|
||||
replacement = "standard method definitions"
|
||||
}
|
||||
|
||||
from ASTNode depr, string type, string replacement
|
||||
from AstNode depr, string type, string replacement
|
||||
where deprecated_feature(depr, type, replacement)
|
||||
select depr, "Use " + replacement + " instead of " + type + "."
|
||||
|
||||
@@ -42,10 +42,10 @@ class CandidateStringLiteral extends StringLiteral {
|
||||
* Gets an ancestor node of this string literal in the AST that can be reached without
|
||||
* stepping over scope elements.
|
||||
*/
|
||||
ASTNode getIntermediate() {
|
||||
AstNode getIntermediate() {
|
||||
result = this
|
||||
or
|
||||
exists(ASTNode mid | mid = this.getIntermediate() |
|
||||
exists(AstNode mid | mid = this.getIntermediate() |
|
||||
not mid instanceof ScopeElement and
|
||||
result = mid.getParent()
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
import javascript
|
||||
|
||||
from JSONValue v, File f
|
||||
from JsonValue v, File f
|
||||
where
|
||||
f = v.getFile() and
|
||||
f.getExtension().regexpMatch("(?i)jsx?") and
|
||||
|
||||
Reference in New Issue
Block a user