We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Codemod does not transform TSTypeReference inside NewExpression
Example input:
import AWS from "aws-sdk"; const arr = new Array<AWS.CloudFormation.StackResourceSummary>();
Returned output:
const arr = new Array<AWS.CloudFormation.StackResourceSummary>();
Replace TSTypeReference inside NewExpression
import { StackResourceSummary } from "@aws-sdk/client-cloudformation"; const arr = new Array<StackResourceSummary>();
N/A
No response
The text was updated successfully, but these errors were encountered:
This happens as jscodeshift does nor detect TSQualifiedName inside NewExpression, like the following:
But it detects TSQualifiedName in types as follows:
const arr: AWS.CloudFormation.StackResourceSummary = new Array();
Sorry, something went wrong.
This appears to be a bug in JSCodeShift, as the following log clearly shows there's a TSQualifiedName for example input.
Log:
console.log(source.find(j.NewExpression).nodes()[0].typeParameters.params[0].typeName.left);
Output:
Node { type: 'TSQualifiedName', start: 50, end: 68, loc: SourceLocation { start: Position { line: 3, column: 22, index: 50, token: 11 }, end: Position { line: 3, column: 40, index: 68, token: 14 }, filename: undefined, identifierName: undefined, lines: Lines { infos: [Array], mappings: [], cachedSourceMap: null, cachedTabWidth: 2, length: 3, name: null }, tokens: [ [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token], [Token] ], indent: 0 }, left: Node { type: 'Identifier', start: 50, end: 53, loc: SourceLocation { start: [Position], end: [Position], filename: undefined, identifierName: 'AWS', lines: [Lines], tokens: [Array], indent: 0 }, name: 'AWS' }, right: Node { type: 'Identifier', start: 54, end: 68, loc: SourceLocation { start: [Position], end: [Position], filename: undefined, identifierName: 'CloudFormation', lines: [Lines], tokens: [Array], indent: 0 }, name: 'CloudFormation' } }
Successfully merging a pull request may close this issue.
Self-service
Problem
Codemod does not transform TSTypeReference inside NewExpression
Example input:
Returned output:
Solution
Replace TSTypeReference inside NewExpression
Alternatives
N/A
Additional context
No response
The text was updated successfully, but these errors were encountered: