tslint-to-eslint-config
Version:
Converts your TSLint configuration to the closest reasonable ESLint equivalent.
26 lines (25 loc) • 865 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeNoEmpty = void 0;
/**
* https://eslint.org/docs/rules/no-empty arguments merger.
*
* The only (and optional) option is `{ allowEmptyCatch: boolean }` which defaults to `{ allowEmptyCatch: false }`.
*
* Since the `false` case is stricter this sould only set `{ allowEmptyCatch: true }` when both inputs enable it.
*/
const mergeNoEmpty = (existingOptions, newOptions) => {
if (
existingOptions === undefined ||
newOptions === undefined ||
existingOptions.length === 0 ||
newOptions.length === 0 ||
!existingOptions[0].allowEmptyCatch ||
!newOptions[0].allowEmptyCatch
) {
return [];
}
return [{ allowEmptyCatch: true }];
};
exports.mergeNoEmpty = mergeNoEmpty;
//# sourceMappingURL=no-empty.js.map