tslint-to-eslint-config
Version:
Converts your TSLint configuration to the closest reasonable ESLint equivalent.
36 lines (35 loc) • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertQuotemark = void 0;
const convertQuotemark = (tslintRule) => {
const notices = [];
const ruleArguments = [];
for (const option of ["jsx-single", "jsx-double", "avoid-template"]) {
if (tslintRule.ruleArguments.includes(option)) {
notices.push(`Option "${option}" is not supported by ESLint.`);
}
}
for (const option of ["single", "double", "backtick"]) {
if (tslintRule.ruleArguments.includes(option)) {
ruleArguments.push(option);
}
}
if (tslintRule.ruleArguments.includes("avoid-escape")) {
ruleArguments.push({ avoidEscape: true });
}
return {
rules: [
{
ruleName: "quotes",
ruleSeverity: "off",
},
{
...(notices.length !== 0 && { notices }),
...(ruleArguments.length !== 0 && { ruleArguments }),
ruleName: "@typescript-eslint/quotes",
},
],
};
};
exports.convertQuotemark = convertQuotemark;
//# sourceMappingURL=quotemark.js.map