Skip to content

Support type-only imports when using verbatimModuleSyntax #311

@superflav

Description

@superflav

TypeScript 5.0 Release introduced verbatimModuleSyntax option which simplifies import elision rules when handling type only imports. With the new option, the user must explicitly specify which imports are type only.

Assuming Type is only used as a type, this:

import { MyContext } from "./myContext";

should be updated to this:

import type { MyContext } from "./myContext";

Currently, however, openapi-codegen has no support for this yet causing issues for projects using verbatimModuleSyntax.

For reference, GraphQL allows this to be toggled on & off via their useTypeImports codegen config option.

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