UNPKG

tslint-to-eslint-config

Version:

Converts your TSLint configuration to the closest reasonable ESLint equivalent.

31 lines (30 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertNoTrailingWhitespace = void 0; const convertNoTrailingWhitespace = (tslintRule) => { const ruleArguments = []; const notices = []; if (tslintRule.ruleArguments.includes("ignore-comments")) { ruleArguments.push({ ignoreComments: true }); } if (tslintRule.ruleArguments.includes("ignore-blank-lines")) { ruleArguments.push({ skipBlankLines: true }); } if (tslintRule.ruleArguments.includes("ignore-template-strings")) { notices.push("ESLint does not support ignoring template strings."); } if (tslintRule.ruleArguments.includes("ignore-jsdoc")) { notices.push("ESLint does not support ignoring JSDoc."); } return { rules: [ { ...(notices.length !== 0 && { notices }), ...(ruleArguments.length !== 0 && { ruleArguments }), ruleName: "no-trailing-spaces", }, ], }; }; exports.convertNoTrailingWhitespace = convertNoTrailingWhitespace; //# sourceMappingURL=no-trailing-whitespace.js.map