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]: destructuring imports #167

Closed
1 task
kuhe opened this issue Nov 18, 2022 · 2 comments
Closed
1 task

[Feature]: destructuring imports #167

kuhe opened this issue Nov 18, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@kuhe
Copy link

kuhe commented Nov 18, 2022

Self-service

  • I'd be willing to implement this feature

Input code

import { Lambda, Sagemaker } from "aws-sdk";
const { S3, EC2 } = require("aws-sdk");

const sagemaker = new SageMaker({});
const lambda = new Lambda({});
const s3 = new S3({});
const ec2 = new EC2({});

Expected Output

import { Lambda } from "@aws-sdk/client-lambda";
import { SageMaker } from "@aws-sdk/client-sagemaker";
const { S3 } = require("@aws-sdk/client-s3");
const { EC2 } = require("@aws-sdk/client-ec2");

const sagemaker = new SageMaker({});
const lambda = new Lambda({});
const s3 = new S3({});
const ec2 = new EC2({});

Additional context

Checkout https://github.com/awslabs/aws-sdk-js-codemod/compare/main...kuhe:aws-sdk-js-codemod:example/imports?expand=1

And run npx jest -t destructure

@kuhe kuhe added the enhancement New feature or request label Nov 18, 2022
@trivikr
Copy link
Member

trivikr commented Jan 6, 2023

Support was added in #242

@trivikr trivikr closed this as completed Jan 6, 2023
@github-actions
Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants