JavaScript: Autoformat all QL files.

This commit is contained in:
Max Schaefer
2019-01-07 10:15:45 +00:00
parent aa6b89dc34
commit 31bb39a810
380 changed files with 9957 additions and 13923 deletions

View File

@@ -13,20 +13,20 @@ import javascript
private import Declarations
from VarAccess acc, VarDecl decl, Variable var, StmtContainer sc
where // the first reference to `var` in `sc` is `acc` (that is, an access, not a declaration)
acc = firstRefInContainer(var, Ref(), sc) and
// `decl` is a declaration of `var` in `sc` (which must come after `acc`)
decl = refInContainer(var, Decl(), sc) and
// exclude globals declared by a linter directive
not exists(Linting::GlobalDeclaration glob |
glob.declaresGlobalForAccess(acc)
) and
// exclude declarations in synthetic constructors
not acc.getEnclosingFunction() instanceof SyntheticConstructor and
// exclude results in ambient contexts
not acc.isAmbient() and
// a class may be referenced in its own decorators
not exists (ClassDefinition cls |
decl = cls.getIdentifier() and
acc.getParent*() = cls.getADecorator())
where
// the first reference to `var` in `sc` is `acc` (that is, an access, not a declaration)
acc = firstRefInContainer(var, Ref(), sc) and
// `decl` is a declaration of `var` in `sc` (which must come after `acc`)
decl = refInContainer(var, Decl(), sc) and
// exclude globals declared by a linter directive
not exists(Linting::GlobalDeclaration glob | glob.declaresGlobalForAccess(acc)) and
// exclude declarations in synthetic constructors
not acc.getEnclosingFunction() instanceof SyntheticConstructor and
// exclude results in ambient contexts
not acc.isAmbient() and
// a class may be referenced in its own decorators
not exists(ClassDefinition cls |
decl = cls.getIdentifier() and
acc.getParent*() = cls.getADecorator()
)
select acc, "Variable '" + acc.getName() + "' is used before its $@.", decl, "declaration"