{ "info": { "author": "Nathan Norton", "author_email": "nthnnrtn@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "hoist-prop-types\n=========\n\nA codemod that will hoist prop types and default props to the top of the file. \nCurrently only works with files with one component.\n\n### Motivation\nThe main purpose is to bring the more important parts of your components, `propTypes`, \nto the top of the file. PropTypes help explains what your component does, almost as \nmuch as the render method. Keeping them close to the top of your file helps minimize \nscrolling and keeps your code that much more consistent. \n\n\n### Input:\n```javascript\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n\nclass MyComponent extends React.Component {\n render() { return null; }\n}\n\nMyComponent.propTypes = {\n name: PropTypes.string,\n};\nMyComponent.defaultProps = {\n name: 'Jim'\n};\n```\n\n### Output:\n```javascript\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\n\nconst PROPS = {\n name: PropTypes.string,\n};\n\nconst DEFAULT_PROPS = {\n name: 'Jim'\n};\n\nclass MyComponent extends React.Component {\n render() { return null; }\n}\n\nMyComponent.propTypes = PROPS;\nMyComponent.defaultProps = DEFAULT_PROPS;\n\n```\n\n`hoist-prop-types` will work with `static propTypes ={...}` that are delared in the class as well.\n\nInstall\n-----------\n```\npip install hoist-prop-types\n```\n\nUsage\n----------\n```\nhoist-prop-types ./my/dir/\n```\n\nThis will read all `.js` and `.jsx` files and try to hoist the prop types to the top.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Xesued/hoist-prop-types", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "hoist-prop-types", "package_url": "https://pypi.org/project/hoist-prop-types/", "platform": "", "project_url": "https://pypi.org/project/hoist-prop-types/", "project_urls": { "Homepage": "https://github.com/Xesued/hoist-prop-types" }, "release_url": "https://pypi.org/project/hoist-prop-types/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Hoist your prop types to the top of a file for readibility", "version": "0.1.1" }, "last_serial": 3243930, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "f67f44905842f05c04f95f63419b74f2", "sha256": "c729a0536bb23345738c51a19ef8b7f1e15e7f9b42f737f6e765da503e949ca6" }, "downloads": -1, "filename": "hoist-prop-types-0.0.1.tar.gz", "has_sig": false, "md5_digest": "f67f44905842f05c04f95f63419b74f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2716, "upload_time": "2017-10-08T21:11:30", "url": "https://files.pythonhosted.org/packages/16/3c/1a8956e590fadc05372975c747907510de1d86ffaa616a68dd2b4b1e54d8/hoist-prop-types-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "8d2745c19062466320f3ae1dd0ceb940", "sha256": "73a3d279d59f527f5ca29f37a004b06934849ba5812cbbe42180902dd620ebb9" }, "downloads": -1, "filename": "hoist-prop-types-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8d2745c19062466320f3ae1dd0ceb940", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2696, "upload_time": "2017-10-08T22:39:01", "url": "https://files.pythonhosted.org/packages/e4/da/092ad3bec67814877cc57d00802f5a4a81a102701fb30961e1ea0a67bb3c/hoist-prop-types-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "bc4629c337d4accb101bb25d38491f2e", "sha256": "38324c7b88711f5b6011cec03e2b7ea411c743c28514a71cb5cc85ab05beeecf" }, "downloads": -1, "filename": "hoist-prop-types-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bc4629c337d4accb101bb25d38491f2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3209, "upload_time": "2017-10-12T02:01:32", "url": "https://files.pythonhosted.org/packages/8b/f6/700a9de99ba134de8aef2f1f8aaaf627b5746304c19816d165579e05c91e/hoist-prop-types-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bc4629c337d4accb101bb25d38491f2e", "sha256": "38324c7b88711f5b6011cec03e2b7ea411c743c28514a71cb5cc85ab05beeecf" }, "downloads": -1, "filename": "hoist-prop-types-0.1.1.tar.gz", "has_sig": false, "md5_digest": "bc4629c337d4accb101bb25d38491f2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3209, "upload_time": "2017-10-12T02:01:32", "url": "https://files.pythonhosted.org/packages/8b/f6/700a9de99ba134de8aef2f1f8aaaf627b5746304c19816d165579e05c91e/hoist-prop-types-0.1.1.tar.gz" } ] }