{"id":13496299,"url":"https://github.com/un-ts/babel-preset-proposal-typescript","last_synced_at":"2025-06-11T13:39:05.311Z","repository":{"id":26894795,"uuid":"110080320","full_name":"un-ts/babel-preset-proposal-typescript","owner":"un-ts","description":"Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.","archived":false,"fork":false,"pushed_at":"2024-10-29T19:01:27.000Z","size":1097,"stargazers_count":26,"open_issues_count":11,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T21:16:31.366Z","etag":null,"topics":["babel","babel-preset","babel-preset-typescript","babel-typescript","typescript"],"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/un-ts.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["JounQin","1stG","rx-ts","un-ts"],"patreon":"1stG","open_collective":"unts","custom":["https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.net/@JounQin"]}},"created_at":"2017-11-09T07:10:17.000Z","updated_at":"2024-02-09T17:10:24.000Z","dependencies_parsed_at":"2022-07-27T08:52:31.921Z","dependency_job_id":"da24b503-4bdb-4146-8860-7a07596203fd","html_url":"https://github.com/un-ts/babel-preset-proposal-typescript","commit_stats":{"total_commits":120,"total_committers":10,"mean_commits":12.0,"dds":"0.19999999999999996","last_synced_commit":"ffafedde7595e2b2decd0bcee83e6a364068091f"},"previous_names":["rx-ts/babel-preset-proposal-typescript"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fbabel-preset-proposal-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fbabel-preset-proposal-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fbabel-preset-proposal-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/un-ts%2Fbabel-preset-proposal-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/un-ts","download_url":"https://codeload.github.com/un-ts/babel-preset-proposal-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245968120,"owners_count":20701972,"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":["babel","babel-preset","babel-preset-typescript","babel-typescript","typescript"],"created_at":"2024-07-31T19:01:45.433Z","updated_at":"2025-03-28T18:31:51.928Z","avatar_url":"https://github.com/un-ts.png","language":"TypeScript","readme":"# babel-preset-proposal-typescript\n\n[![GitHub Actions](https://github.com/un-ts/babel-preset-proposal-typescript/workflows/CI/badge.svg)](https://github.com/un-ts/babel-preset-proposal-typescript/actions/workflows/ci.yml)\n[![Codecov](https://img.shields.io/codecov/c/github/un-ts/babel-preset-proposal-typescript.svg)](https://codecov.io/gh/un-ts/babel-preset-proposal-typescript)\n[![npm](https://img.shields.io/npm/v/babel-preset-proposal-typescript.svg)](https://www.npmjs.com/package/babel-preset-proposal-typescript)\n[![GitHub Release](https://img.shields.io/github/release/un-ts/babel-preset-proposal-typescript)](https://github.com/un-ts/babel-preset-proposal-typescript/releases)\n\n[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)\n\nYet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.\n\nSo that you can use babel to transform proposals which are current in stage 0-2 and TypeScript team [will not implement them temporarily](https://github.com/Microsoft/TypeScript/issues/19044#event-1293164503).\n\n## TOC \u003c!-- omit in toc --\u003e\n\n- [Enabled proposal plugins](#enabled-proposal-plugins)\n- [Install](#install)\n- [Options](#options)\n- [Usage](#usage)\n  - [Via `.babelrc` (Recommended)](#via-babelrc-recommended)\n  - [Via CLI](#via-cli)\n  - [Via Node API](#via-node-api)\n  - [Via webpack](#via-webpack)\n- [References](#references)\n- [Sponsors](#sponsors)\n- [Backers](#backers)\n- [Changelog](#changelog)\n- [License](#license)\n\n## Enabled proposal plugins\n\n1.  [async-do-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-async-do-expressions)\n2.  [destructuring-private](https://www.npmjs.com/package/@babel/plugin-proposal-destructuring-private)\n3.  [do-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-do-expressions)\n4.  [duplicate-named-capturing-groups-regex](https://www.npmjs.com/package/@babel/plugin-proposal-duplicate-named-capturing-groups-regex)\n5.  [function-bind](https://www.npmjs.com/package/@babel/plugin-proposal-function-bind)\n6.  [function-sent](https://www.npmjs.com/package/@babel/plugin-proposal-function-sent)\n7.  [import-defer](https://www.npmjs.com/package/@babel/plugin-proposal-import-defer)\n8.  [import-wasm-source](https://www.npmjs.com/package/@babel/plugin-proposal-import-wasm-source)\n9.  [optional-chaining-assign](https://www.npmjs.com/package/@babel/plugin-proposal-optional-chaining-assign)\n10. [partial-application](https://www.npmjs.com/package/@babel/plugin-proposal-partial-application)\n11. [pipeline-operator](https://www.npmjs.com/package/@babel/plugin-proposal-pipeline-operator)\n12. [record-and-tuple](https://www.npmjs.com/package/@babel/plugin-proposal-record-and-tuple)\n13. [regexp-modifiers](https://www.npmjs.com/package/@babel/plugin-proposal-regexp-modifiers)\n14. [throw-expressions](https://www.npmjs.com/package/@babel/plugin-proposal-throw-expressions)\n15. [v8intrinsic](./src/v8intrinsic.ts) - [Further Detail](https://babeljs.io/blog/2019/09/05/7.6.0#v8-intrinsic-runtime-functions-parsing-10148httpsgithubcombabelbabelpull10148)\n\n## Install\n\n```sh\n# yarn\nyarn add -D babel-preset-proposal-typescript\n\n# npm\nnpm i -D babel-preset-proposal-typescript\n```\n\n## Options\n\n| option                          | description                                                                                                  | defaults                                                                |\n| ------------------------------- | ------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------- |\n| `decoratorsBeforeExport`        | See [Babel Document](https://babeljs.io/docs/en/babel-plugin-proposal-decorators#decoratorsbeforeexport)     | `undefined`                                                             |\n| `decoratorsLegacy`              | Whether to use legacy decorators semantic                                                                    | `true`                                                                  |\n| `importDefer`                   | Whether to enabled `import-defer` plugin, if true `transform-modules-commonjs` will be enabled automatically | `false`                                                                 |\n| `isTSX`                         | Whether to enable `jsx` plugin with `typescript`                                                             | `false`, but `true` for `/\\.[jt]sx$/`                                   |\n| `optionalChainingAssignVersion` | Version for `optional-chaining-assign` plugin, only `'2023-07'` allowed for now                              | `'2023-07'`                                                             |\n| `pipelineOperator`              | Implementation of pipeline operator, `minimal`, `smart` or `fsharp`                                          | `minimal`                                                               |\n| `recordTuplePolyfill`           | Whether to enable import `record-tuple` plugin and polyfill, or specific the polyfill module name            | `true` for Node\u003e=14.6, it represents `@bloomberg/record-tuple-polyfill` |\n| `recordTupleSyntaxType`         | `record-tuple` syntax, `hash` or `bar`                                                                       | `hash`                                                                  |\n\n## Usage\n\nNote that unlike plugins, the presets are applied in an order of last to first (\u003chttps://babeljs.io/docs/en/presets/#preset-ordering\u003e), so please make sure `proposal-typescript` is used at the last.\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"presets\": [\"proposal-typescript\"]\n}\n```\n\n### Via CLI\n\n```sh\nbabel input.ts --presets proposal-typescript \u003e output.ts\n```\n\n### Via Node API\n\n```js\nrequire('@babel/core').transform('code', {\n  presets: ['proposal-typescript'],\n})\n```\n\n### Via webpack\n\nPipe codes through `babel-loader`.\n\n```js\nloader = {\n  test: /\\.[jt]sx?$/,\n  loader: 'babel-loader',\n  options: {\n    presets: ['@babel/typescript', 'proposal-typescript'],\n  },\n}\n\n// if you prefer `ts-loader` or `awesome-typescript-loader`\nloader = {\n  test: /\\.tsx?$/,\n  use: [\n    {\n      loader: 'ts-loader',\n    },\n    {\n      loader: 'babel-loader',\n      options: {\n        presets: ['proposal-typescript'],\n      },\n    },\n  ],\n}\n```\n\n## References\n\n- [TC39 Proposals](https://github.com/tc39/proposals)\n- [Babel Proposals](https://github.com/babel/proposals)\n\n## Sponsors\n\n| 1stG                                                                                                                               | RxTS                                                                                                                               | UnTS                                                                                                                               |\n| ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/organizations.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/organizations.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/organizations.svg)](https://opencollective.com/unts) |\n\n## Backers\n\n[![Backers](https://raw.githubusercontent.com/1stG/static/master/sponsors.svg)](https://github.com/sponsors/JounQin)\n\n| 1stG                                                                                                                             | RxTS                                                                                                                             | UnTS                                                                                                                             |\n| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| [![1stG Open Collective backers and sponsors](https://opencollective.com/1stG/individuals.svg)](https://opencollective.com/1stG) | [![RxTS Open Collective backers and sponsors](https://opencollective.com/rxts/individuals.svg)](https://opencollective.com/rxts) | [![UnTS Open Collective backers and sponsors](https://opencollective.com/unts/individuals.svg)](https://opencollective.com/unts) |\n\n## Changelog\n\nDetailed changes for each release are documented in [CHANGELOG.md](./CHANGELOG.md).\n\n## License\n\n[MIT][] © [JounQin][]@[1stG.me][]\n\n[1stg.me]: https://www.1stg.me\n[jounqin]: https://GitHub.com/JounQin\n[mit]: http://opensource.org/licenses/MIT\n","funding_links":["https://github.com/sponsors/JounQin","https://github.com/sponsors/1stG","https://github.com/sponsors/rx-ts","https://github.com/sponsors/un-ts","https://patreon.com/1stG","https://opencollective.com/unts","https://opencollective.com/1stG","https://opencollective.com/rxts","https://afdian.net/@JounQin"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Fbabel-preset-proposal-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fun-ts%2Fbabel-preset-proposal-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fun-ts%2Fbabel-preset-proposal-typescript/lists"}