tslint-to-eslint-config
Version:
Converts your TSLint configuration to the closest reasonable ESLint equivalent.
28 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeNoUnnecessaryTypeAssertion = void 0;
const mergeNoUnnecessaryTypeAssertion = (existingOptions, newOptions) => {
if (existingOptions === undefined && newOptions === undefined) {
return [];
}
let typesToIgnore;
for (const options of [existingOptions, newOptions]) {
if (options === undefined ||
options.length === 0 ||
options[0].typesToIgnore === undefined) {
continue;
}
if (typesToIgnore === undefined) {
typesToIgnore = [];
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
typesToIgnore.push(...options[0].typesToIgnore);
}
return [
{
...(typesToIgnore !== undefined && { typesToIgnore }),
},
];
};
exports.mergeNoUnnecessaryTypeAssertion = mergeNoUnnecessaryTypeAssertion;
//# sourceMappingURL=no-unnecessary-type-assertion.js.map