aws-sdk-js-codemod
aws-sdk-js-codemod copied to clipboard
[Feature]: If input import is type only then output import should be type only
Self-service
- [ ] I'd be willing to implement this feature
Problem
The typeOnly import is replaced to normal import by codemod
Example input:
import type { DescribeStacksInput } from "aws-sdk/clients/cloudformation";
const foo: DescribeStacksInput = {};
Example output:
import { DescribeStacksCommandInput } from "@aws-sdk/client-cloudformation";
const foo: DescribeStacksCommandInput = {};
Solution
If input contains typeonly import, use typeonly export in output
import type { DescribeStacksCommandInput } from "@aws-sdk/client-cloudformation";
const foo: DescribeStacksCommandInput = {};
Alternatives
N/A
Additional context
https://github.com/getlift/lift/blob/a91e293dcd889b3d0153444ed0b55afea470822f/src/CloudFormation.ts#L1