mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Revert "TypeScript: disable queries that rely on token information"
This reverts commit 003b600e24.
This commit is contained in:
@@ -45,5 +45,4 @@ class OmittedArrayElement extends ArrayExpr {
|
||||
}
|
||||
|
||||
from OmittedArrayElement ae
|
||||
where not ae.getFile().getFileType().isTypeScript() // ignore quirks in TypeScript tokenizer
|
||||
select ae, "Avoid omitted array elements."
|
||||
@@ -36,8 +36,7 @@ where s.hasSemicolonInserted() and
|
||||
asi = strictcount(Stmt ss | asi(sc, ss, true)) and
|
||||
nstmt = strictcount(Stmt ss | asi(sc, ss, _)) and
|
||||
perc = ((1-asi/nstmt)*100).floor() and
|
||||
perc >= 90 and
|
||||
not s.getFile().getFileType().isTypeScript() // ignore some quirks in the TypeScript tokenizer
|
||||
perc >= 90
|
||||
select (LastLineOf)s, "Avoid automated semicolon insertion " +
|
||||
"(" + perc + "% of all statements in $@ have an explicit semicolon).",
|
||||
sc, "the enclosing " + sctype
|
||||
@@ -39,7 +39,6 @@ where misleadingIndentationCandidate(ctrl, s1, s2) and
|
||||
f.hasIndentation(ctrlStartLine, indent, _) and
|
||||
f.hasIndentation(startLine1, indent, _) and
|
||||
f.hasIndentation(startLine2, indent, _) and
|
||||
not s2 instanceof EmptyStmt and
|
||||
not f.getFileType().isTypeScript() // ignore quirks in TypeScript tokenizer
|
||||
not s2 instanceof EmptyStmt
|
||||
select (FirstLineOf)s2, "The indentation of this statement suggests that it is controlled by $@, while in fact it is not.",
|
||||
(FirstLineOf)ctrl, "this statement"
|
||||
Reference in New Issue
Block a user