Closed chriskrycho closed 5 years ago
@chriskrycho absolutely, would love that!
Idk if there is so much to do here, I guess the difficult part is to make jscodeshift correctly parse (and emit) TS? See...
Actually, @rwjblue already did all the hard work, and recast latest supports it. I may ping you on something I got stuck on, but making progress.
Should be able to do:
let parser = require('recast/parsers/typescript');
let j = api.jscodeshift.withParser(parser);
In places like:
But I really would like to find the time to migrate this repo to codemod-cli (assuming @simonihmig is ok with that), which exposes a getParser()
helper method and manages the recast
/ @babel/parser
/ jscodeshift
deps with the right versions...
But I really would like to find the time to migrate this repo to codemod-cli
I could give this a try as well. @rwjblue I guess https://github.com/rwjblue/ember-qunit-codemod/pull/114/files would be a good starting point to see what's needed?
Ya, that was the roadmap I was gonna follow...
Here we go: #28
@chriskrycho I merged #28, hope that does not give you too many merge conflicts (in case you already forked). Feel free to ping me if I can be of any help!
I'll just test that – from what I saw of codemod-cli, I literally won't have anything else to do! 😍
It would be awesome if this operated on TypeScript! (Read: I'm about to start hacking on it, I just wanted this here in case someone else had the idea and was wondering about the status of it.)