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
typeMessageIds=ESLintUtils.InferMessageIdsTypeFromRule<typeofrule>// 'preferConcatLatestFrom'typeOptions=ESLintUtils.InferOptionsTypeFromRule<typeofrule>// [{ readonly strict: boolean; }]constvalid: TSESLint.RunTests<MessageIds,Options>['valid']=[]constinvalid: TSESLint.RunTests<MessageIds,Options>['invalid']=[fromFixture(``,{options: [{strict: true}],// here I get the error described belowoutput: ``,}),]
Type 'InvalidTestCase<"preferConcatLatestFrom", { strict: boolean; }[]>' is not assignable to type 'InvalidTestCase<"preferConcatLatestFrom", Options>'.
Types of property 'options' are incompatible.
Type 'readonly { strict: boolean; }[]' is not assignable to type 'readonly [{ strict: boolean; }]'.
Target requires 1 element(s) but source may have fewer.ts(2322)
So, to fix this, I can either do options: [{ strict: true }] as const or { output: ..., options: ... } as const and so the TS is happy, however fromFixture doesn't accept readonly arrays...
I believe that it's a simple change:
- export declare function fromFixture<TMessageIds extends string, TOptions extends unknown[]>+ export declare function fromFixture<TMessageIds extends string, TOptions extends readonly unknown[]>
Consider this scenario:
So, to fix this, I can either do
options: [{ strict: true }] as const
or{ output: ..., options: ... } as const
and so the TS is happy, howeverfromFixture
doesn't accept readonly arrays...I believe that it's a simple change:
and
Let me know if this case was clear enough to describe the issue (and I'm able to help submitting a PR if that's the case).
The text was updated successfully, but these errors were encountered: