tslint-to-eslint-config
Version:
Converts your TSLint configuration to the closest reasonable ESLint equivalent.
27 lines (26 loc) • 806 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatMissingRules = void 0;
const formatMissingRules = (missing, rulesDirectory = []) => {
const rules = {};
for (const rule of missing.sort((a, b) => a.ruleName.localeCompare(b.ruleName))) {
if (rule.ruleSeverity !== "off") {
rules[rule.ruleName] = formatRuleArguments(rule);
}
}
return [
"error",
{
...(rulesDirectory.length !== 0 && { rulesDirectory }),
rules,
},
];
};
exports.formatMissingRules = formatMissingRules;
const formatRuleArguments = (rule) => {
if (rule.ruleArguments.length === 0) {
return true;
}
return [true, ...rule.ruleArguments];
};
//# sourceMappingURL=formatMissingRules.js.map