UNPKG

textlint

Version:

The pluggable linting tool for text and markdown.

50 lines 1.15 kB
/** * Convert rulesObject to TextlintKernelRule * { * "rule-name": rule * }, * { * "rule-name": ruleOption * } * * => TextlintKernelRule */ export const rulesObjectToKernelRule = (rules, rulesOption) => { return Object.keys(rules).map((ruleId) => { return { ruleId, rule: rules[ruleId], options: rulesOption[ruleId] }; }); }; export const filterRulesObjectToKernelRule = (rules, rulesOption) => { return Object.keys(rules).map((ruleId) => { return { ruleId, rule: rules[ruleId], options: rulesOption[ruleId] }; }); }; /** * Convert pluginsObject to TextlintKernelPlugin * { * "plugin-name": plugin * }, * { * "plugin-name": pluginOption * } * * => TextlintKernelPlugin */ export const pluginsObjectToKernelRule = (plugins, pluginsOption) => { return Object.keys(plugins).map((pluginId) => { return { pluginId, plugin: plugins[pluginId], options: pluginsOption[pluginId] }; }); }; //# sourceMappingURL=object-to-kernel-format.js.map