You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the possibility exists for filtering to result in an empty object (i.e. Record<string, never>), this forces us to provide an initialValue in the Array.reduce() which incorrectly allows the TypeScript compiler to infer that all inputs can become {}.
Describe the solution you'd like
To improve the typings, we can change the return type to be the flattened object resulting from flattenObject():
ReturnType<typeofflattenObject<T>>
However, this type definition requires using Instantiation Expressions which will be added in the TypeScript 4.7 release.
Additional context
The use of type arguments for generic functions or generic constructions (i.e. Instantiation Expressions), currently throws errors from @typescript-eslint/eslint-plugin. ehaynes99/typescript-eslint-instantation-expressions includes a minimum reproduction build for these ESLint errors in anticipation of TS 4.7.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
The return type for
filterObject()
is subtly incorrect:synectic/src/containers/format.ts
Lines 146 to 150 in 68281d0
Although the possibility exists for filtering to result in an empty object (i.e.
Record<string, never>
), this forces us to provide aninitialValue
in theArray.reduce()
which incorrectly allows the TypeScript compiler to infer that all inputs can become{}
.Describe the solution you'd like
To improve the typings, we can change the return type to be the flattened object resulting from
flattenObject()
:However, this type definition requires using Instantiation Expressions which will be added in the TypeScript 4.7 release.
Additional context
The use of type arguments for generic functions or generic constructions (i.e. Instantiation Expressions), currently throws errors from
@typescript-eslint/eslint-plugin
. ehaynes99/typescript-eslint-instantation-expressions includes a minimum reproduction build for these ESLint errors in anticipation of TS 4.7.The text was updated successfully, but these errors were encountered: