remove all existing @ts-expect-error?

remove all existing @ts-expect-error?
11 Replies
LukeAbby
LukeAbbyOP6mo ago
or sprinkle them in to a reasonable degree
Eon
Eon6mo ago
The latter
LukeAbby
LukeAbbyOP6mo ago
then yeah you probably can at least at your current rate
Eon
Eon6mo ago
no (circularity) errors & a performant intellisense is my goal :LaughingSor:
LukeAbby
LukeAbbyOP6mo ago
I'll try my best on the circularity errors you seem to have ~25 right now
Eon
Eon6mo ago
Tomorrow I'm planning on doing the remaining data models, I've still got about a dozen of embedded ones to go, when that's done it's basically the circularities + sheets
LukeAbby
LukeAbbyOP6mo ago
I'll admit this one is forboding:
src/module/combat/document.ts(67,19): error TS2321: Excessive stack depth comparing types '(a: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }, b: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }) => number' and '(a: CombatantPTR2e, b: CombatantPTR2e) => number'.
src/module/combat/document.ts(67,19): error TS2321: Excessive stack depth comparing types '(a: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }, b: { initiative: Maybe<number>; id: string | null; actor: Actor | null; preview?: boolean | undefined; }) => number' and '(a: CombatantPTR2e, b: CombatantPTR2e) => number'.
it probably has to do with all your mixins? stack depth is a very rare type of circularity for fvtt-types to run into in the grand scheme of things probably your mixins or that other absolutely massive error
Eon
Eon6mo ago
which one is that? xD like in what file/class?
LukeAbby
LukeAbbyOP6mo ago
the one on _onUpdate
Eon
Eon6mo ago
Ah, is that a wrong override typing one?
LukeAbby
LukeAbbyOP6mo ago
src/module/actor/base.ts(1844,22): error TS2416: Property '_onUpdate' in type 'ActorPTR2e' is not assignable to the same property in base type 'Actor'.
Type '(changed: DeepPartial<AssignmentType<Schema, DefaultOptions>>, options: OnUpdateOptions<any>, userId: string) => void' is not assignable to type '((changed: RemoveIndexSignatures<{}>, options: OnUpdateOptions<any>, userId: string) => void) & ((changed: RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseActor, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseActor, DefaultOptions>; prototypeToken?: AssignmentType<typeof PrototypeToken, DefaultOptions>; items?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseItem, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseItem, DefaultOptions>; effects?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; label: "EFFECT.Label"; }>; img?: AssignmentType<{ categories: "IMAGE"[]; label: "EFFECT.Image"; }>; type?: AssignmentType<typeof BaseActiveEffect, { initial: "base"; }>; system?: AssignmentType<typeof BaseActiveEffect, DefaultOptions>; changes?: AssignmentType<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>, string, string>; mode: NumberField<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }, AssignmentType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>>; priority: NumberField<DefaultOptions, AssignmentType<DefaultOptions>, InitializedType<DefaultOptions>, InitializedType<DefaultOptions>>; }, SimpleMerge<DefaultOptions, DefaultOptions>>, DefaultOptions<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>,
src/module/actor/base.ts(1844,22): error TS2416: Property '_onUpdate' in type 'ActorPTR2e' is not assignable to the same property in base type 'Actor'.
Type '(changed: DeepPartial<AssignmentType<Schema, DefaultOptions>>, options: OnUpdateOptions<any>, userId: string) => void' is not assignable to type '((changed: RemoveIndexSignatures<{}>, options: OnUpdateOptions<any>, userId: string) => void) & ((changed: RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseActor, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseActor, DefaultOptions>; prototypeToken?: AssignmentType<typeof PrototypeToken, DefaultOptions>; items?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; blank: false; textSearch: true; }>; type?: AssignmentType<typeof BaseItem, DefaultOptions>; img?: AssignmentType<{ categories: "IMAGE"[]; initial: (data: unknown) => string; }>; system?: AssignmentType<typeof BaseItem, DefaultOptions>; effects?: AssignmentType<RemoveIndexSignatures<{ [x: string]: unknown; _id?: AssignmentType<DefaultOptions>; name?: AssignmentType<{ required: true; label: "EFFECT.Label"; }>; img?: AssignmentType<{ categories: "IMAGE"[]; label: "EFFECT.Image"; }>; type?: AssignmentType<typeof BaseActiveEffect, { initial: "base"; }>; system?: AssignmentType<typeof BaseActiveEffect, DefaultOptions>; changes?: AssignmentType<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>, string, string>; mode: NumberField<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }, AssignmentType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>, InitializedType<{ integer: true; initial: 2 & Branded<"constants.ACTIVE_EFFECT_MODES">; label: "EFFECT.ChangeMode"; }>>; priority: NumberField<DefaultOptions, AssignmentType<DefaultOptions>, InitializedType<DefaultOptions>, InitializedType<DefaultOptions>>; }, SimpleMerge<DefaultOptions, DefaultOptions>>, DefaultOptions<AssignmentType<{ key: StringField<{ required: true; label: "EFFECT.ChangeKey"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeKey"; }>, string, string>; value: StringField<{ required: true; label: "EFFECT.ChangeValue"; }, AssignmentType<{ required: true; label: "EFFECT.ChangeValue"; }>,

Did you find this page helpful?