Created
January 14, 2020 22:08
-
-
Save jbrown215/5e827c719bc197cfd3e8e4027af54f84 to your computer and use it in GitHub Desktop.
Flow exact-by-default jscodeshift transform
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
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