@elsikora/eslint-config
Version:
ESLint configuration vision of ElsiKora
22 lines (18 loc) • 706 B
JavaScript
;
var pluginMap_constant = require('../constant/utility/plugin-map.constant.js');
/**
* Formats a rule name according to mapping rules
* @param {string} ruleName - The name of the rule to format
* @returns {string} The formatted rule name
*/
function formatRuleName(ruleName) {
for (const [oldName, newName] of Object.entries(pluginMap_constant.PLUGIN_MAP).sort((a, b) => b[0].length - a[0].length)) {
const oldPrefix = `${oldName}/`;
if (ruleName.startsWith(oldName)) {
return ruleName.replace(oldPrefix, `${newName}/`);
}
}
return ruleName;
}
exports.formatRuleName = formatRuleName;
//# sourceMappingURL=format-rule-name.utility.js.map