Ben Newman

Results 203 comments of Ben Newman

@bnjmnt4n A while back I put in some effort to minimize/eliminate `ast-types` dependencies for `recast.parse` and `recast.print` (though of course `recast.visit` and `recast.types` still depend on `ast-types`). Moving to `FastPath`...

@octogonz Thanks for working on this! Unfortunately, this would be a breaking change, since folks are supposed to be able to import, say, `ast-types/def/babel.js` in order to build a custom...

That said, if there are parts of this PR that you'd like to extract into separate PRs (that don't affect the project structure), they would probably get merged sooner!

The `Scope` code was written before `let` and `const` were so universally supported, but that's no excuse. I should definitely fix this. Thanks for bringing it to my attention.

@bmeck is working on this as part of https://github.com/benjamn/ast-types/pull/157

Technically the location object that really matters is `newNode.original.loc`, so you might be able to do `newNode.original = oldNode.original`. Then, if `newNode.type === oldNode.type`, the reprinter should be able to...

Ahh, I think `def/typescript.js` needs to redefine the fields of the `Identifier` type, like `def/flow.js` is doing, to include a `typeAnnotation` field with type `TSTypeAnnotation | null`. One wrinkle: we...

What if you provided the parent type name, and it's an error if a parent of that type is not found?

Comments are special/hard because their relationship to the nodes they annotate is so hard to infer. That's partly because they can appear anywhere, even in places where no real node...

Related: https://github.com/benjamn/recast/issues/191