Skip to content

chore: update eslint RuleTester typing mismatch #151

@rbitting

Description

@rbitting

Not super urgent, but many unit tests have to use hacky casting to declare the RuleModule types. This appears to be due to a type mismatch between the rule (which is a RuleModule type from @typescript-eslint/utils) and the eslint RuleTester which expects a RuleModule type from eslint.

Argument of type 'RuleModule<"noEmptyComponents", [], { JSXElement(node: JSXElement): void; }>' is not assignable to parameter of type 'RuleModule'.

To properly resolve the issue, the RuleTester should be updated to be imported from @typescript-eslint/rule-tester.

https://typescript-eslint.io/packages/rule-tester/

Note: implementing @typescript-eslint/rule-tester may require a tsconfig moduleResolution change making this a bigger update than it would originally seem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions