Skip to content

v0.6.0

Compare
Choose a tag to compare
@fkling fkling released this 04 Dec 00:54

A bunch of changes to get jscodeshift in a better shape. This is minor version update because important dependencies and parser configurations have changed.


New

  • New CLI option --parser-config: This option accepts a path to a JSON file and overrides the default options for flow or babylon. This allows you to tweak parser settings (e.g. legacy decorators). (46d250f)
  • New CLI option --stdin: If provided, the list of files/directories is read from stdin. This makes it easier to pass large lists of files. (b6eaa0a)
  • New API in transforms: api.report lets you print arbitrary text to stdout. Useful if another tools consumes jscodeshift's stdout. (c902a00) Example:
// In the transform
api.report('some data');

// in stdout
 REP path/to/file.js some data
  • Support for Typescript source code, via babylon ( #286 ; @brieb). Use --parser=ts or --parser=tsx.

Improvements

Fixes

  • JSXElements's hasAttributes method understands value-less Boolean attributes (#277 , @artemruts )
  • More reliable printing to stdout (62b12ad)

Internal

  • Replaces deprecated nomnom with own implementation (a2becc5)
  • Remove direct dependency on lodash (4701096)