Skip to content

Commit 25224cc

Browse files
author
Max Schaefer
committed
Revert "TypeScript: disable queries that rely on token information"
This reverts commit 003b600.
1 parent 2e49cd1 commit 25224cc

4 files changed

Lines changed: 2 additions & 17 deletions

File tree

javascript/ql/src/LanguageFeatures/EmptyArrayInit.ql

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,4 @@ class OmittedArrayElement extends ArrayExpr {
4545
}
4646

4747
from OmittedArrayElement ae
48-
where not ae.getFile().getFileType().isTypeScript() // ignore quirks in TypeScript tokenizer
4948
select ae, "Avoid omitted array elements."

javascript/ql/src/LanguageFeatures/SemicolonInsertion.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ where s.hasSemicolonInserted() and
3636
asi = strictcount(Stmt ss | asi(sc, ss, true)) and
3737
nstmt = strictcount(Stmt ss | asi(sc, ss, _)) and
3838
perc = ((1-asi/nstmt)*100).floor() and
39-
perc >= 90 and
40-
not s.getFile().getFileType().isTypeScript() // ignore some quirks in the TypeScript tokenizer
39+
perc >= 90
4140
select (LastLineOf)s, "Avoid automated semicolon insertion " +
4241
"(" + perc + "% of all statements in $@ have an explicit semicolon).",
4342
sc, "the enclosing " + sctype

javascript/ql/src/Statements/MisleadingIndentationAfterControlStmt.ql

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ where misleadingIndentationCandidate(ctrl, s1, s2) and
3939
f.hasIndentation(ctrlStartLine, indent, _) and
4040
f.hasIndentation(startLine1, indent, _) and
4141
f.hasIndentation(startLine2, indent, _) and
42-
not s2 instanceof EmptyStmt and
43-
not f.getFileType().isTypeScript() // ignore quirks in TypeScript tokenizer
42+
not s2 instanceof EmptyStmt
4443
select (FirstLineOf)s2, "The indentation of this statement suggests that it is controlled by $@, while in fact it is not.",
4544
(FirstLineOf)ctrl, "this statement"

javascript/ql/test/query-tests/LanguageFeatures/SemicolonInsertion/template_literal.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)