mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
eslint-config: upgrade @typescript-eslint
This commit is contained in:
5 files changed
+260
-25
No files matched your search
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
export type Atomic = number | string | boolean | bigint | symbol | Date | any[];
|
||||
export type Values<S> = S[keyof S];
|
||||
export type Intersect<U> = (U extends any ? (arg: U) => void : never) extends ((arg: infer I) => void) ? I : never;
|
||||
@@ -10,8 +9,8 @@ export type ArrayKeys<O, P = any> = {
|
||||
}[keyof O];
|
||||
type FlatWrap<S, T, P extends string> = { [K in P]?: S } | (S extends T ? never // rule out atomic / recursive types
|
||||
: S extends any[] ? never // rule out array types
|
||||
: string extends keyof S ? never // rule out dict / infinite types
|
||||
: FlatMap<S, T, `${P}.`>);
|
||||
: string extends keyof S ? never // rule out dict / infinite types
|
||||
: FlatMap<S, T, `${P}.`>);
|
||||
type FlatMap<S, T = Atomic, P extends string = ''> = Values<{
|
||||
[K in keyof S & string as `${P}${K}`]: FlatWrap<S[K], S | T, `${P}${K}`>
|
||||
}>;
|
||||
|
||||
Reference in new issue
Block a user