UNPKG

tslint-to-eslint-config

Version:

Converts your TSLint configuration to the closest reasonable ESLint equivalent.

30 lines (29 loc) 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertOnlyArrowFunctions = void 0; const convertOnlyArrowFunctions = (tslintRule) => { const notices = []; if (tslintRule.ruleArguments.includes("allow-named-functions")) { notices.push( "ESLint (eslint-plugin-prefer-arrow plugin) does not support allowing named functions defined with the function keyword.", ); } return { rules: [ { ...(notices.length !== 0 && { notices }), ruleArguments: [ { ...(tslintRule.ruleArguments.includes("allow-declarations") && { allowStandaloneDeclarations: true, }), }, ], ruleName: "prefer-arrow/prefer-arrow-functions", }, ], plugins: ["eslint-plugin-prefer-arrow"], }; }; exports.convertOnlyArrowFunctions = convertOnlyArrowFunctions; //# sourceMappingURL=only-arrow-functions.js.map