Skip to content

Typescript ignore "import types" #443

@danikaze

Description

@danikaze

This is related to this issue.

Specifying

detectiveOptions: {
  ts: {
    skipTypeImports: true,
  }
}

works only for this kind of code

import type { TypeName } from 'path';

but TS is clever enough to auto-detect types (as they don't generate any output on the JS), so this

import { TypeName } from 'path'; // no "type" keyword

should work the same, when TypeName is a type, an interface, a const enum or anything that doesn't generate anything in memory.

In summary, skipTypeImports should work not when there's a import type, but also based on the nature of the imported property as well when there's a basic import.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions