Skip to content

Instantly share code, notes, and snippets.

@thecodegoddess
Forked from jbrown215/transform.js
Created January 7, 2023 10:34
Show Gist options
  • Save thecodegoddess/505b928fb61eb04298b0cf829055470a to your computer and use it in GitHub Desktop.
Save thecodegoddess/505b928fb61eb04298b0cf829055470a 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