Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: If input import is type only then output import should be type only #734

Open
1 task
trivikr opened this issue Nov 13, 2023 · 0 comments
Open
1 task
Labels
enhancement New feature or request p3 This is a minor priority issue

Comments

@trivikr
Copy link
Member

trivikr commented Nov 13, 2023

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

@trivikr trivikr added the enhancement New feature or request label Nov 13, 2023
@trivikr trivikr added the p3 This is a minor priority issue label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

1 participant