Description
What about that?
import { parse } from 'parse-function'
const pluginsArray = [
(node, result) => {},
(astNode, result) => {},
]
const result = parse(string|Function, parserOptions, pluginsArray)
// or without passing parser options
const result = parse(string|Function, pluginsArray)
We are just removing the extra step of creating "app" instance and then calling parse
.
Also removing the use
so called "smart plugins", we don't need to change anything to that "app" instance.
So now plugins are more simpler and flat, instead of (app) => (node, result) => {}
Should be noted that we can't just add plugins
property to the parserOptions
, because will conflict with babylon
for example.