-
Notifications
You must be signed in to change notification settings - Fork 15
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
Isolated declarations improvements to triple slash directives and imports. #94
Isolated declarations improvements to triple slash directives and imports. #94
Conversation
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
…invalid code. Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
cf61980
to
99ce432
Compare
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
…fied with the codemod Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
Signed-off-by: Titian Cernicova-Dragomir <tcernicovad1@bloomberg.net>
99ce432
to
e772096
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just some questions to ask for clarifications.
newLine: settings.newLine, | ||
target: settings.target, | ||
removeComments: false, | ||
omitTrailingSemicolon: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why have you set this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It created some print differences with original tests
@@ -54,7 +54,7 @@ function findNearestParentWithTypeAnnotation(node: ts.Node): ts.Node | undefined | |||
export function addTypeAnnotationTransformer(sourceFile: ts.SourceFile, program: ts.Program, moduleResolutionHost?: ts.ModuleResolutionHost) { | |||
const typeChecker = program.getTypeChecker(); | |||
const nodesToFix = new Map(program.getDeclarationDiagnostics(sourceFile). | |||
filter((diag) => diag.code === 9007). | |||
filter((diag) => diag.code === 9007 || diag.code === 9009). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing I should write a fix for the new error code 9009
by adding declarations to property assignments happening in functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention is to use the new error code for both function declarations and expressions. But yes, it would be helpful to treat the error for expando function declarations.
if(node.initializer && localType && strictNullChecks && !resolver.isOptionalParameter(node)) { | ||
localType.typeNode = addUndefinedInUnion(localType.typeNode); | ||
else { | ||
localType = invalid(node); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify what this chunk of changes imply? I don't think I understood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially wanted to support types parameters that are not annotated (ok under noImplicitAny: false
). Turns out that has several complications so I decided to revert the support for those.
No description provided.