Closed samcooke98 closed 4 years ago
I'm having issues getting a transformer working with anything from typescript version 3.8 upwards. Reading through the code I see a couple of // todo typescript 3.8 kind of comments.
// todo typescript 3.8
My transformer looks something like;
const visitor = (node: ts.Node): ts.Node | ts.Node[] => { console.log(node.kind, `\t# ts.SyntaxKind.${ts.SyntaxKind[node.kind]}`); return ts.visitEachChild(node, visitor, context); }; ts.visitNode(sourceFile, visitor);
On Typescript 3.7, this output something like:
/Users/samcooke/work/misc/test/node_modules/.bin/ttsc 288 # ts.SyntaxKind.SourceFile 253 # ts.SyntaxKind.ImportDeclaration 254 # ts.SyntaxKind.ImportClause [ ...more
On Typescript 3.8, this outputs
$ /Users/samcooke/work/misc/test/node_modules/.bin/ttsc 290 # ts.SyntaxKind.UnparsedSource undefined
I'd be willing to work on this, maybe with some pointers.
It seems this issue was caused by having multiple versions of typescript in the repo.
typescript
I solved this by adding a resolutions property to package.json.
resolutions
package.json
"resolutions": { "typescript": "3.8.3" }
I'm having issues getting a transformer working with anything from typescript version 3.8 upwards. Reading through the code I see a couple of
// todo typescript 3.8
kind of comments.My transformer looks something like;
On Typescript 3.7, this output something like:
On Typescript 3.8, this outputs
I'd be willing to work on this, maybe with some pointers.