mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Packaging: Rafactor Javascript core libraries
Extract the external facing `qll` files into the codeql/javascript-all query pack.
This commit is contained in:
29
javascript/ql/lib/semmle/javascript/frameworks/Prettier.qll
Normal file
29
javascript/ql/lib/semmle/javascript/frameworks/Prettier.qll
Normal 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()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user