{"id":23174584,"url":"https://github.com/vscodeshift/flow-codemorphs","last_synced_at":"2025-04-05T00:43:26.196Z","repository":{"id":40783595,"uuid":"243419171","full_name":"vscodeshift/flow-codemorphs","owner":"vscodeshift","description":"general purpose codemods for flow","archived":false,"fork":false,"pushed_at":"2023-01-05T08:25:51.000Z","size":4035,"stargazers_count":1,"open_issues_count":22,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-10T09:15:15.911Z","etag":null,"topics":["codemods","flow","flowtype","jscodeshift","refactoring"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vscodeshift.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-27T03:11:13.000Z","updated_at":"2022-04-08T22:41:06.000Z","dependencies_parsed_at":"2023-02-03T20:30:58.510Z","dependency_job_id":null,"html_url":"https://github.com/vscodeshift/flow-codemorphs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscodeshift%2Fflow-codemorphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscodeshift%2Fflow-codemorphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscodeshift%2Fflow-codemorphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vscodeshift%2Fflow-codemorphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vscodeshift","download_url":"https://codeload.github.com/vscodeshift/flow-codemorphs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271492,"owners_count":20911586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codemods","flow","flowtype","jscodeshift","refactoring"],"created_at":"2024-12-18T05:30:17.189Z","updated_at":"2025-04-05T00:43:26.159Z","avatar_url":"https://github.com/vscodeshift.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @vscodeshift/flow-codemorphs\n\n[![CircleCI](https://circleci.com/gh/vscodeshift/flow-codemorphs.svg?style=svg)](https://circleci.com/gh/vscodeshift/flow-codemorphs)\n[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)\n[![Visual Studio Marketplace Version](https://img.shields.io/visual-studio-marketplace/v/vscodeshift.flow-codemorphs)](https://marketplace.visualstudio.com/items?itemName=vscodeshift.flow-codemorphs)\n\ngeneral purpose codemods for flow\n\n# Commands\n\n\u003c!-- toc --\u003e\n\n- [make exact](#make-exact)\n- [make inexact](#make-inexact)\n- [make read-only](#make-read-only)\n\n\u003c!-- tocstop --\u003e\n\n# make exact\n\nConverts object shape types to exact objects.\n\nIf you position the cursor inside a type annotation, only objects within that\ntype annotation are converted.\n\nIf there is a selection, only objects within the selection are converted.\n\n## Example\n\n### Before\n\n```ts\n\n// @flow\n\ntype Foo = {\n  bar: number,\n  baz: Array\u003c{\n    qux: number,\n    blah: $ReadOnly\u003c{\n      blsdf: string,\n    }\u003e,\n    glorb: {a: number}[],\n    ...\n  }\u003e,\n}\n\n```\n\n### After\n\n```ts\n\n// @flow\n\ntype Foo = {|\n  bar: number,\n  baz: Array\u003c{|\n    qux: number,\n    blah: $ReadOnly\u003c{| blsdf: string |}\u003e,\n    glorb: {| a: number |}[],\n  |}\u003e,\n|}\n\n```\n\n# make inexact\n\nConverts object shape types to inexact objects.\n\nIf you position the cursor inside a type annotation, only objects within that\ntype annotation are converted.\n\nIf there is a selection, only objects within the selection are converted.\n\n## Example\n\n### Before\n\n```ts\n\n// @flow\n\ntype Foo = {|\n  bar: number,\n  baz: Array\u003c{\n    qux: number,\n    blah: $ReadOnly\u003c{|\n      blsdf: string,\n    |}\u003e,\n    glorb: {a: number}[],\n    ...\n  }\u003e,\n|}\n\n```\n\n### After\n\n```ts\n\n// @flow\n\ntype Foo = {\n  bar: number,\n  baz: Array\u003c{\n    qux: number,\n    blah: $ReadOnly\u003c{ blsdf: string, ... }\u003e,\n    glorb: { a: number, ... }[],\n    ...\n  }\u003e,\n  ...\n}\n\n```\n\n# make read-only\n\nConverts mutable object shape and array types to readonly types.\n\nIf you position the cursor inside a type annotation, only objects\nand arrays within that type annotation are converted.\n\nIf there is a selection, only objects and arrays within the selection are converted.\n\n## Example\n\n### Before\n\n```ts\n// @flow\n\ntype Foo = {\n  bar: number\n  baz: Array\u003c{\n    qux: number\n    blah: $ReadOnly\u003c{\n      blsdf: string\n    }\u003e\n    glorb: { a: number }[]\n  }\u003e\n}\n```\n\n### After\n\n```ts\n// @flow\n\ntype Foo = $ReadOnly\u003c{\n  bar: number\n  baz: $ReadOnlyArray\u003c\n    $ReadOnly\u003c{\n      qux: number\n      blah: $ReadOnly\u003c{\n        blsdf: string\n      }\u003e\n      glorb: $ReadOnlyArray\u003c$ReadOnly\u003c{ a: number }\u003e\u003e\n    }\u003e\n  \u003e\n}\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvscodeshift%2Fflow-codemorphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvscodeshift%2Fflow-codemorphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvscodeshift%2Fflow-codemorphs/lists"}