tslint-to-eslint-config
Version:
Converts your TSLint configuration to the closest reasonable ESLint equivalent.
27 lines (26 loc) • 1.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.convertFileCommentsStandalone = void 0;
const parseFileComments_1 = require("../converters/comments/parseFileComments");
const replaceFileComments_1 = require("../converters/comments/replaceFileComments");
const ruleConverters_1 = require("../converters/lintConfigs/rules/ruleConverters");
/**
* Replaces TSLint disable comments in source code with their ESLint equivalent.
*/
const convertFileCommentsStandalone = ({
fileContent,
filePath,
ruleCommentsCache = new Map(),
ruleEquivalents = new Map(),
}) => {
const comments = (0, parseFileComments_1.parseFileComments)(filePath, fileContent);
return (0, replaceFileComments_1.replaceFileComments)(
fileContent,
comments,
ruleConverters_1.ruleConverters,
ruleCommentsCache,
ruleEquivalents,
);
};
exports.convertFileCommentsStandalone = convertFileCommentsStandalone;
//# sourceMappingURL=convertFileCommentsStandalone.js.map