UNPKG

tslint-to-eslint-config

Version:

Converts your TSLint configuration to the closest reasonable ESLint equivalent.

49 lines (48 loc) 1.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertSemicolon = void 0; const convertSemicolon = (tslintRule) => { const getMultilineDelimiter = (strategy) => { return strategy === "always" ? "semi" : "none"; }; const ignoreInterfaces = tslintRule.ruleArguments.includes("ignore-interfaces"); const strictBoundClassMethods = tslintRule.ruleArguments.includes("strict-bound-class-methods"); return { ...(strictBoundClassMethods && { notices: [ "Option `strict-bound-class-methods` was found, there is no exact equivalent yet supported.", ], }), rules: [ { ruleName: "semi", ruleSeverity: "off", }, { ruleArguments: [tslintRule.ruleArguments[0]], ruleName: "@typescript-eslint/semi", }, ...(ignoreInterfaces ? [] : [ { ruleArguments: [ { multiline: { delimiter: getMultilineDelimiter(tslintRule.ruleArguments[0]), requireLast: true, }, singleline: { delimiter: "semi", requireLast: false, }, }, ], ruleName: "@typescript-eslint/member-delimiter-style", }, ]), ], }; }; exports.convertSemicolon = convertSemicolon; //# sourceMappingURL=semicolon.js.map