Open SamuelMarks opened 9 years ago
This is exactly ts => estree
(test runner does that), estree => ts
is not interesting as there is almost no tools that accept TS AST while ESTree has a lot of such.
Yeah, escodegen
is awesome, would be great to extend it with TypeScript syntax support (but first its input needs to be TypeScript AST!)
Nah, I'm talking about Babel plugins, ESLint and so on. Emitting TypeScript is rarely needed as usually you want to transpile and check the code at the same time without loosy intermediate string representation.
Oh right, my use-case is different, I am code-generating TypeScript, then reparsing the TypeScript and modifying certain subsets then emitting the replacement TypeScript.
With ESTree you don't need to generate, reparse and so on as you can simply use ESTree transformations (estraverse, esrecurse, Babel - whatever works best) and treat TypeScript nodes as Flow nodes (unfortunately, I didn't have time to add those but should be trivial enough if you want to contribute).
Hmm, well if you get the chance a trivial example would be much appreciated :)
@SamuelMarks @RReverser Did this project get migrated somewhere else. I'm interested in having ESTREE support for TS, so that I can directly integrate it into webpacks Parser which uses acorn parser behind the scenes.
@TheLarkInn I think https://github.com/eslint/typescript-eslint-parser might be a more up-to-date project with similar goals.
@Rreverser While exploring, did you find the ts-tree specification documented somewhere (similar to es-tree)? Working on something and just having that will be really useful
@bendtherules i started preparing documentation for estree with ts, https://github.com/armano2/typescript-estree-test/blob/master/typescript-estree.spec.d.ts
but this is for https://github.com/JamesHenry/typescript-estree -> used by prettier and typescript-eslint-parser
So is there a full pipeline now, from ts-tree to TypeScript and back again?
Happy to work on the estree => ts side, but is there a simple example of ts => estree?