Skip to content

prefer-describe-function-title false positive on type imports #954

Description

@leeyi45

In Typescript it is possible to specify that something is only a "type" import - that is it gets elided at runtime, which means that the code below is an error:

import type { TestFunc } from '../types';

describe(TestFunc, () => {});

since TestFunc is just a type and can't be used as a value. But prefer-describe-function-title insists on converting the string TestFunc into an identifier:

import type { TestFunc } from '../types';

describe('TestFunc', () => {}); // is highlighted as an error

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