textlint
Version:
The pluggable linting tool for text and markdown.
32 lines • 995 B
JavaScript
// LICENSE : MIT
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPresetRuleKey = exports.isPluginRuleKey = void 0;
function isPluginRuleKey(key) {
// @<owner>/<plugin><>rule>
if (key[0] === "@" && key.indexOf("/textlint-plugin") !== -1) {
return true;
}
// not contain @, but contain /
// <plugin>/<rule>
return key[0] !== "@" && key.indexOf("/") !== -1;
}
exports.isPluginRuleKey = isPluginRuleKey;
function isPresetRuleKey(key) {
// "preset-name" is special pattern
if (/^preset-/.test(key)) {
return true;
}
if (/^textlint-rule-preset-/.test(key)) {
return true;
}
// scoped module: @textlint/textlint-rule-preset-foo
if (key[0] === "@") {
if (key.indexOf("/preset-") !== -1 || key.indexOf("/textlint-rule-preset-") !== -1) {
return true;
}
}
return false;
}
exports.isPresetRuleKey = isPresetRuleKey;
//# sourceMappingURL=config-util.js.map