Releases: facebook/jscodeshift
Releases · facebook/jscodeshift
v0.3.10
v0.3.9
v0.3.8
Improvements
-
jscodeshift.match
and many methods that accept an object as second argument for filtering / pattern matching (e.g..find
) now also accept functions / objects containing functions. This allows you to write more complex filters more easily.Example:
j(source) .find(j.VariableDeclarator, {id: node => node.name === 'foo' || node.name === 'bar'})
finds all VariableDeclarator
s whose identifier is either named "foo" or "bar".
Internal changes
jscodeshift switched to jest v0.5.10, which means that tests will only run in Node v4+. jscodeshift will likely continue to function in older Node versions though.
v0.3.7
v0.3.6
v0.3.5
Fixes
- File extension filter only applies to files in traversed directories, not to directly passed files
- Enforce latest recast version that fixes some printing issues
- Remove
esprima-fb
dependency
Changes
- Depend on
babel-core
instead ofbabel
v0.3.4
v0.3.3
v0.3.2
v0.3.0
New
- ES7 support for transform files: Transform files (and its dependencies) are now passed through Babel (using Babel's
require
hook). That means you can use ES7 syntax in your transform files. If you already transpiled the transformer or don't use any ES6 features that need to be transpiled, you can pass the--no-babel
option. - Directory traversal: Until now jscodeshift only worked on files. Now, if a path to a directory is passed, it will recursively find over all files matching the file extension provided through
--extension
(defaults tojs
). - Remove nodes: Node collections now have a
.remove
method which removes all selected nodes from the AST.