Skip to content

ava/use-test does not allow anyTest in .cts and .mts files #353

Open
@gebsh

Description

@gebsh

Currently, the ava/use-test allows naming the default import anyTest instead of test in TypeScript files:

In a TypeScript file (.ts or .tsx) AVA can be assigned to a variable named anyTest in order to define the types of t.context (see Typing t.context).

However, TS 4.7 introduced new file extensions, .cts and .mts, that are not recognized by this rule.

For example, the following import statement does not report any violations when placed in a file foo.ts:

import anyTest from 'ava';

Renaming the file to foo.cts or foo.mts produces the following warning, though:

AVA should be imported as `test`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions