jscodeshift
jscodeshift copied to clipboard
A JavaScript codemod toolkit.
jscodeshift throws `SyntaxError: Unexpected token, expected ","` for typescript file with just types
## Describe the bug jscodeshift throws `SyntaxError: Unexpected token, expected ","` for typescript file with just types ``` jscodeshift: 0.13.1 - babel: 7.17.5 - babylon: 7.17.3 - flow: 0.173.0 -...
### Is your feature request related to a problem? Please describe. The releases are managed internally by Meta employees which makes it difficult to publish new versions. These release can...
Here is an example: ``` const j = api.jscodeshift; j('(a = b)[c]') .find(j.MemberExpression) .replaceWith(({node: {object, property, computed}}) => j.memberExpression(object, property, computed)) .toSource() ``` gives the result ``` a = b[c]...
It seems like docs hasn't been updated for almost 2 years. Unless there's an afterwork required after running docs script this should be trivial. (If this is the case, I'm...
jsdoc can't be bumped up any higher than 3.7 because 3.8 and onwards makes use of a version of the klaw library that doesn't run on node versions less than...
This can be reproduced using https://astexplorer.net/ and the sample code below. This is my first time using `jscodeshift`, so I may be holding something wrong. If I strip out all...
I'm trying to use the `Collections#closest` method. Here's what `docs/traversalMethods.html` says:  Problems: 1. The parameters table is incorrect. 1. Writing `closest()` without parameters suggests that the method doesn't take...
```js TypeError: Cannot read property 'error' of undefined \node_modules\jscodeshift\node_modules\babel-core\lib\transformation\file\options\option-manager.js:126 if (!option) this.log.error("Unknown option: " + alias + "." + key, ReferenceError); ^ ``` Love the idea of the tool, unfortunately...
Add support for `jscodeshift -t http://astexplorer.net/#/QaBzVS9XHK`
@fkling and I have both identified that this is useful. What should the API be? We could do a filter: ``` js j.find(j.Identifier).filter(j.identifierIsVariable) ``` or a find: ``` js j.find(j.OurIdentifierType)...