Skip to content

Instantly share code, notes, and snippets.

@jbrown215
Created January 14, 2020 22:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jbrown215/5e827c719bc197cfd3e8e4027af54f84 to your computer and use it in GitHub Desktop.
Save jbrown215/5e827c719bc197cfd3e8e4027af54f84 to your computer and use it in GitHub Desktop.
Flow exact-by-default jscodeshift transform
module.exports = function transformer(file, api) {
const j = api.jscodeshift;
const root = j(file.source);
root
.find(j.ObjectTypeAnnotation, {inexact: false, exact: false})
.forEach(path => {
path.node.inexact = true;
});
return root.toSource();
};
module.exports.parser = 'flow';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment