Packaging: Rafactor Javascript core libraries

Extract the external facing `qll` files into the codeql/javascript-all
query pack.
This commit is contained in:
Andrew Eisenberg
2021-08-25 12:02:31 -07:00
parent 48344d9ffc
commit 45d1fa7f01
410 changed files with 41 additions and 10 deletions

View File

@@ -0,0 +1,29 @@
/**
* Provides classes and predicates for working with the [prettier](https://www.npmjs.com/package/prettier) library.
*/
import javascript
/** Provides classes and predicates modelling aspects of the [prettier](https://www.npmjs.com/package/prettier) library. */
private module Prettier {
/**
* A taint step from the [prettier API](https://prettier.io/docs/en/api.html).
*/
private class PrettierTaintStep extends TaintTracking::SharedTaintStep {
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
exists(API::CallNode call |
call = API::moduleImport("prettier").getMember("format").getACall()
|
pred = call.getArgument(0) and
succ = call
)
or
exists(API::CallNode call |
call = API::moduleImport("prettier").getMember("formatWithCursor").getACall()
|
pred = call.getArgument(0) and
succ = call.getReturn().getMember("formatted").getAnImmediateUse()
)
}
}
}