-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check only for client constructors in named imports (#212)
- Loading branch information
Showing
6 changed files
with
48 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"aws-sdk-js-codemod": patch | ||
--- | ||
|
||
Check only for client constructors in named imports |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/unsupported-type-import.input.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// ToDo: Update when transformation is added. | ||
// Current test verifies error is not thrown. | ||
import { ListTablesInputLimit } from "aws-sdk/clients/dynamodb"; |
3 changes: 3 additions & 0 deletions
3
src/transforms/v2-to-v3/__fixtures__/unsupported-type-import.output.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
// ToDo: Update when transformation is added. | ||
// Current test verifies error is not thrown. | ||
import { ListTablesInputLimit } from "aws-sdk/clients/dynamodb"; |
6 changes: 3 additions & 3 deletions
6
...o-v3/utils/get/getImportIdentifierName.ts → ...v2-to-v3/utils/get/getImportSpecifiers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import { Collection, JSCodeshift } from "jscodeshift"; | ||
|
||
export const getImportIdentifierName = ( | ||
export const getImportSpecifiers = ( | ||
j: JSCodeshift, | ||
source: Collection<unknown>, | ||
literalValue: string | ||
): string | undefined => | ||
) => | ||
source | ||
.find(j.ImportDeclaration, { | ||
source: { value: literalValue }, | ||
}) | ||
.nodes()[0]?.specifiers?.[0]?.local?.name; | ||
.nodes()[0]?.specifiers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters