putout-engine-runner
Load putout plugins.
Install
npm i @putout/engine-runner
Example
const {runPlugins} = require('@putout/engine-runner');
const {parse} = require('@putout/engin-parser');
const plugins = [{
rule: "remove-debugger",
msg: "",
options: {},
plugin:
include: () => ['debugger'],
fix: (path) => path.remove(),
report: () => `debugger should not be used`,
}];
const ast = parse('const m = "hi"; debugger');
const places = runPlugins({
ast,
shebang: false,
fix: true,
fixCount: 1
plugins,
parser: 'babel',
});
License
MIT