Currently, I am in the process of developing a builder that incorporates various types. The method I use to define the type is as follows:
export type BuilderInterface<T> = {
[key in keyof T]: (arg: T[key]) => BuilderInterface<T>;
} & {
build(): T;
}
However, when I run ESLint, it gives me a warning stating:
"BuilderInteface" was used before it was defined (no-use-before-define)
. This makes sense since each argument function must return a builder of the same kind.
I am now exploring different approaches to declaring this without violating the eslint rule. Should I consider directly ignoring the rule? What are the reasons for and against doing so?