UNPKG

@praha/eslint-config-definer

Version:
8 lines (7 loc) 630 B
import type { Linter } from 'eslint'; type ExtractOptionType<T> = T extends Configurator<infer U> ? U : never; type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; export type MergeOptionTypes<T extends any[]> = UnionToIntersection<ExtractOptionType<T[number]>>; export type Configurator<T = void> = T extends void ? (() => Linter.Config[]) : ((options: T) => Linter.Config[]); export declare const define: <T extends ((() => Linter.Config[]) | ((options: any) => Linter.Config[]))[]>(configurators: T) => (options: MergeOptionTypes<T>) => Linter.Config[]; export {};