grandsilence / swagger-typescript-api-nextgen

Fork of TypeScript API generator via Swagger scheme (next generation).
MIT License
13 stars 3 forks source link

`--modular` flag generates type imports without `type` keyword which triggers `ts(1444)` #7

Open wvffle opened 2 years ago

wvffle commented 2 years ago

In a project that I am working on, we have strict typescript rules enabled and every imported type must be a import type { Type } from 'module' type of import. Otherwise it triggers an error:

image

The correct code generated here should be:

import type { Actor, Album, Artist, Library, Track } from "./data-contracts";
import type { RequestParams } from "./http-client";
import { ContentType, HttpClient } from "./http-client";