This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// converts commonJS requires to es6 imports | |
// var foo = require('foo'); | |
// -> | |
// import foo from 'foo'; | |
// | |
// jscodeshift -t requiresToImports.js src/**/*.js* | |
'use strict'; | |
module.exports = function(fileInfo, api) { | |
var j = api.jscodeshift; |