ast-types icon indicating copy to clipboard operation
ast-types copied to clipboard

Esprima-compatible implementation of the Mozilla JS Parser API

Results 138 ast-types issues
Sort by recently updated
recently updated
newest added

![Screenshot from 2020-03-28 18-06-43](https://user-images.githubusercontent.com/17699717/77877551-b1527c80-7273-11ea-965d-441bb2c6c1dc.png) Input contains [dynamic import](https://javascript.info/modules-dynamic-imports#the-import-expression)

When use this module in typescript , can not get a type NodePath. ```ts import { NodePath} from 'ast-types' ... recast.visit(ast, { // 'NodePath' refers to a value, but is...

From `es6.js`: ``` def("Property") .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) .field("value", or(def("Expression"), def("Pattern"))) .field("method", Boolean, defaults["false"]) .field("shorthand", Boolean, defaults["false"]) .field("computed", Boolean, defaults["false"]); ``` How do I set the `method`, `shorthand`, and `computed`...

This code: function setComment(node: types.Node, comment: types.Comment) { node.comments = [comment]; } Results in the following error: error TS2322: Type 'Comment[]' is not assignable to type 'CommentKind[]'. Type 'Comment' is...

Write the builders syntax by hand is really tedious, can we provide some package like `@babel/template` or add an online playground to convert the code to builders syntax. It will...

Hey, I'm trying to use `jscodeshift` to create this pattern: ``` function HelloWorld({ name = 'luna' }) { ... } ``` The object property looks like the following when this...

I'm trying to use `ast-types` to do ast tree parsing in `eslint` rules. But it changes some ast tree nodes, thus not compatible with `eslint` rules The code is ```javascript...

I was just trying out my very first bit of jscodeshift and got immediately stuck with an issue that my object destructuring assignments weren't appearing as bindings. I've tracked it...

Hello! I am new to language parsing so please correct me if I use the wrong terminology. I'm searching for a library that would hand be an AST that would...

An idea I've been playing with: I have got a situation where I am going to take my custom AST, perform some optimizing transforms, and then use that AST to...