UNPKG

tslint-to-eslint-config

Version:

Converts your TSLint configuration to the closest reasonable ESLint equivalent.

31 lines (30 loc) 1.02 kB
"use strict"; 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