@putout/engine-loader
Version:
load plugins and prepare them to run
24 lines (19 loc) • 469 B
JavaScript
const supportedKeys = [
'find',
'traverse',
'replace',
'include',
'exclude',
'rules',
'declare',
'scan',
];
module.exports = ({plugin, rule}) => {
const keys = Object.keys(plugin);
for (const key of supportedKeys) {
if (keys.includes(key))
return;
}
throw Error(`☝️ Cannot determine type of plugin '${rule}'. Here is list of supported plugins: https://git.io/JqcMn`);
};
;