UNPKG

@elsikora/eslint-config

Version:

ESLint configuration vision of ElsiKora

20 lines (17 loc) 651 B
import { PLUGIN_MAP } from '../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(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; } export { formatRuleName }; //# sourceMappingURL=format-rule-name.utility.js.map