{"id":13739722,"url":"https://github.com/remcohaszing/babel-plugin-transform-react-class-to-function","last_synced_at":"2025-08-27T11:07:58.787Z","repository":{"id":66086578,"uuid":"138471236","full_name":"remcohaszing/babel-plugin-transform-react-class-to-function","owner":"remcohaszing","description":"A Babel 7 plugin which transforms React component classes into functions","archived":false,"fork":false,"pushed_at":"2021-11-06T18:31:52.000Z","size":1366,"stargazers_count":24,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-28T10:11:28.115Z","etag":null,"topics":["babel","react"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/remcohaszing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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}},"created_at":"2018-06-24T10:00:37.000Z","updated_at":"2024-07-16T15:01:08.000Z","dependencies_parsed_at":"2023-03-10T23:36:49.790Z","dependency_job_id":null,"html_url":"https://github.com/remcohaszing/babel-plugin-transform-react-class-to-function","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":"0.017857142857142905","last_synced_commit":"240b69a2dd7d3b090fcfd66582a93db6a92e4593"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/remcohaszing/babel-plugin-transform-react-class-to-function","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fbabel-plugin-transform-react-class-to-function","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fbabel-plugin-transform-react-class-to-function/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fbabel-plugin-transform-react-class-to-function/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fbabel-plugin-transform-react-class-to-function/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remcohaszing","download_url":"https://codeload.github.com/remcohaszing/babel-plugin-transform-react-class-to-function/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remcohaszing%2Fbabel-plugin-transform-react-class-to-function/sbom","scorecard":{"id":770121,"data":{"date":"2025-08-11","repo":{"name":"github.com/remcohaszing/babel-plugin-transform-react-class-to-function","commit":"240b69a2dd7d3b090fcfd66582a93db6a92e4593"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":5,"reason":"dependency not pinned by hash detected -- score normalized to 5","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/remcohaszing/babel-plugin-transform-react-class-to-function/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/remcohaszing/babel-plugin-transform-react-class-to-function/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/remcohaszing/babel-plugin-transform-react-class-to-function/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/remcohaszing/babel-plugin-transform-react-class-to-function/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/remcohaszing/babel-plugin-transform-react-class-to-function/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/remcohaszing/babel-plugin-transform-react-class-to-function/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/remcohaszing/babel-plugin-transform-react-class-to-function/ci.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:31","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   3 out of   4 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/remcohaszing/.github/SECURITY.md:1","Info: Found linked content: github.com/remcohaszing/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/remcohaszing/.github/SECURITY.md:1","Info: Found text in security policy: github.com/remcohaszing/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T01:58:58.002Z","repository_id":66086578,"created_at":"2025-08-23T01:58:58.002Z","updated_at":"2025-08-23T01:58:58.002Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272324333,"owners_count":24914398,"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","status":"online","status_checked_at":"2025-08-27T02:00:09.397Z","response_time":76,"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":["babel","react"],"created_at":"2024-08-03T04:00:36.854Z","updated_at":"2025-08-27T11:07:58.750Z","avatar_url":"https://github.com/remcohaszing.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":["React"],"readme":"# babel-plugin-transform-react-class-to-function\n\n\u003e A Babel 7 plugin which transforms React component classes into functions\n\n[![npm version][npm-image]][npm-url] [![build status][github-actions-image]][github-actions-url]\n[![codecov][codecov-image]][codecov-url]\n\nWriting React components using the class syntax has several benefits:\n\n- **Consistency** — Define all components using similar syntax.\n- **Static properties** — Components are more self contained when using static class properties.\n- **Simpler diffs** — No need to change the entire indentation converting between classes and\n  functions.\n\nThere is one obvious downside:\n\n- **Size** — Class components are larger than function components.\n\nThis plugin solves that for you. 😃\n\n## Example\n\n### In\n\n```js\nimport PropTypes from 'prop-types';\nimport { Component } from 'react';\n\nexport class HelloWorld extends Component {\n  static propTypes = {\n    className: PropTypes.string,\n  };\n\n  render() {\n    const { className } = this.props;\n\n    return \u003cdiv className={className}\u003eHello world!\u003c/div\u003e;\n  }\n}\n```\n\n### Out\n\n```js\nimport PropTypes from 'prop-types';\nimport { Component } from 'react';\n\nexport const HelloWorld = ({ className }) =\u003e \u003cdiv className={className}\u003eHello world!\u003c/div\u003e;\n\nHelloWorld.propTypes = {\n  className: PropTypes.string,\n};\n```\n\n## Installation\n\n```sh\nnpm install @babel/core babel-plugin-transform-react-class-to-function\n```\n\n## Usage\n\n### Via `babel.config.js` (Recommended)\n\n```js\nmodule.exports = (api) =\u003e ({\n  plugins: ['babel-plugin-transform-react-class-to-function'],\n});\n```\n\n### Via CLI\n\n```sh\nbabel --plugins babel-plugin-transform-react-class-to-function\n```\n\n### Via Node API\n\n```js\nrequire('@babel/core').transform(code, {\n  plugins: ['babel-plugin-transform-react-class-to-function'],\n});\n```\n\n## Options\n\n### `memo`\n\n- `true`: Transform `PureComponent` and components implementing `shouldComponentUpdate` to\n  functional components using [React memo].\n- `false` (default): Don’t transform `PureComponent` or components implementing\n  `shouldComponentUpdate`.\n\n## Special Thanks\n\nThis plugin was originally based on [babel-plugin-transform-react-pure-class-to-function]. However,\nthe project has diverged a lot. You may want to give that project a try if you need to use babel 6.\n\n[babel-plugin-transform-react-pure-class-to-function]:\n  https://www.npmjs.com/package/babel-plugin-transform-react-pure-class-to-function\n[codecov-image]:\n  https://codecov.io/gh/remcohaszing/babel-plugin-transform-react-class-to-function/branch/main/graph/badge.svg\n[codecov-url]: https://codecov.io/gh/remcohaszing/babel-plugin-transform-react-class-to-function\n[npm-image]: https://img.shields.io/npm/v/babel-plugin-transform-react-class-to-function.svg\n[npm-url]: https://www.npmjs.com/package/babel-plugin-transform-react-class-to-function\n[react memo]: https://reactjs.org/docs/react-api.html#reactmemo\n[github-actions-image]:\n  https://github.com/remcohaszing/babel-plugin-transform-react-class-to-function/workflows/ci/badge.svg\n[github-actions-url]:\n  https://github.com/remcohaszing/babel-plugin-transform-react-class-to-function/actions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Fbabel-plugin-transform-react-class-to-function","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremcohaszing%2Fbabel-plugin-transform-react-class-to-function","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremcohaszing%2Fbabel-plugin-transform-react-class-to-function/lists"}