aws / aws/aws-sdk-js-codemod

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

Open
#734 0 comments 0 reactions 0 assignees View on GitHub
enhancement p3
Dominant language
TypeScript
Stars
89
Forks
13
Avg merge
9h 59m
Merged PRs (30d)
1

Description

### Self-service

- [ ] I'd be willing to implement this feature

### Problem

The typeOnly import is replaced to normal import by codemod

Example input:
```js
import type { DescribeStacksInput } from "aws-sdk/clients/cloudformation";

const foo: DescribeStacksInput = {};
```

Example output:
```js
import { DescribeStacksCommandInput } from "@aws-sdk/client-cloudformation";

const foo: DescribeStacksCommandInput = {};
```

### Solution

If input contains typeonly import, use typeonly export in output

```js
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

Contributor guide

Open the contributing guide

Research direction

Review the linked src/CloudFormation.ts example, then locate the codemod transform responsible for converting AWS SDK imports. Add coverage for the shown type-only input and output behavior, and verify that the generated import remains type-only.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.