{"id":24455621,"url":"https://github.com/putoutjs/babel-wrap","last_synced_at":"2026-04-28T09:02:30.867Z","repository":{"id":186180272,"uuid":"674779896","full_name":"putoutjs/babel-wrap","owner":"putoutjs","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-04T19:00:26.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-24T05:13:26.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/putoutjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-04T18:57:55.000Z","updated_at":"2024-08-28T08:07:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"653fd6c1-2a14-4fdd-af1b-441be868f67b","html_url":"https://github.com/putoutjs/babel-wrap","commit_stats":null,"previous_names":["putoutjs/babel-wrap"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/putoutjs/babel-wrap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fbabel-wrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fbabel-wrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fbabel-wrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fbabel-wrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/putoutjs","download_url":"https://codeload.github.com/putoutjs/babel-wrap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/putoutjs%2Fbabel-wrap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32373515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-01-21T02:13:58.914Z","updated_at":"2026-04-28T09:02:30.838Z","avatar_url":"https://github.com/putoutjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🗿 Using Babel Plugins with Putout\n\nYou can add `Babel` to the `plugins` section of `.putout.json` with `babel/` prefix.\n\n*You can disable a rule, or use a match in a similar way.*\n\n*☝️Remember to omit `babel-plugin-` or `@babel/plugin`: putout will set it up for you :)*\n\n*Example*\nLet's add `babel-plugin-transform-inline-consecutive-adds` to `.putout.json`:\n\n```json\n{\n    \"plugins\": [\n        \"babel/transform-inline-consecutive-adds\"\n    ]\n}\n```\n\nThen create a file and process it with the help of **Babel Plugin**.\n\n```sh\ncoderaiser@cloudcmd:~$ cat \u003e a.js\nconst t = [];\nt.push(1);\nt.push(2);\n\ncoderaiser@cloudcmd:~$ PUTOUT_PRINTER=babel putout a.js -f codeframe\n/home/coderaiser/a.js:4:0\n  2 | t.push(1);\n  3 | t.push(2);\n\u003e 4 |\n    | ^ transform inline consecutive adds\n\n✖ 1 errors in 1 files\n  fixable with the `--fix` option\ncoderaiser@cloudcmd:~$ putout --fix a.js\ncoderaiser@cloudcmd:~$ cat a.js\nconst t = [1, 2];\n```\n\nUsing 🐊**Putout** as a runner for `babel` `plugins` you can not only change file content, but also see what exactly will be changed. You can use your already written `babel` `plugins` or reuse work in progress plugins made for `babel`,\n\n☝️ *Remember 🐊**Putout** `plugins` gave more accurate information about changing places, and works faster (no need to find information about changes in transformed file).*\n\n### Babel plugins list\n\nHere you can find **Babel Plugins** which feats the most main purpose of 🐊**Putout** and advised to use:\n\n\u003cdetails\u003e\u003csummary\u003e\u003ca href=\"https://babeljs.io/docs/en/babel-plugin-transform-inline-consecutive-adds\"\u003etransform-inline-consecutive-adds\u003c/a\u003e\u003c/summary\u003e\n\n```diff\n-const foo = {};\n-foo.a = 42;\n-foo.b = [\"hi\"];\n-foo.c = bar();\n-foo.d = \"str\";\n+const foo = {\n+  a: 42,\n+  b: [\"hi\"],\n+  c: bar(),\n+  d: \"str\"\n+};\n\n-const bar = [];\n-bar.push(1);\n-bar.push(2);\n+const bar = [1, 2];\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003ca href=\"https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-object-assign-to-object-spread\"\u003ecodemod-object-assign-to-object-spread\u003c/a\u003e\u003c/summary\u003e\n\n```diff\nfunction merge(a) {\n-   return Object.assign({}, a, {\n-       hello: 'world'\n-   });\n+   return {\n+       ...a,\n+       hello: 'world'\n+   };\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003ca href=\"https://github.com/babel/babel/tree/master/codemods/babel-plugin-codemod-optional-catch-binding\"\u003ecodemod-optional-catch-binding\u003c/a\u003e\u003c/summary\u003e\n\n```diff\ntry {\n    throw 0;\n-} catch (err) {\n+} catch {\n    console.log(\"it failed, but this code executes\");\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003ca href=\"https://github.com/putoutjs/babel-plugin-angularjs-annotate\"\u003eangularjs-annotate\u003c/a\u003e\u003c/summary\u003e\n\n```diff\n-angular.module(\"MyMod\").controller(\"MyCtrl\", ($scope, $timeout) =\u003e {});\n+angular.module(\"MyMod\").controller(\"MyCtrl\", [\"$scope\", \"$timeout\", ($scope, $timeout) =\u003e {}]);\n```\n\n\u003c/details\u003e\n\nPlease send pull requests with **Babel Plugins** which can be used as codemods, or simplify, fix, makes code more readable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputoutjs%2Fbabel-wrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fputoutjs%2Fbabel-wrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputoutjs%2Fbabel-wrap/lists"}