Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peoplenarthax/cleaner-codemods
Simple codemods to beautify your code
https://github.com/peoplenarthax/cleaner-codemods
Last synced: 3 months ago
JSON representation
Simple codemods to beautify your code
- Host: GitHub
- URL: https://github.com/peoplenarthax/cleaner-codemods
- Owner: peoplenarthax
- License: mit
- Created: 2017-11-08T09:02:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-08T11:36:21.000Z (over 7 years ago)
- Last Synced: 2024-08-02T07:17:15.323Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-codemods - cleaner-codemods - Simple codemods to destructure prop types. (JavaScript)
README
## Cleaner-Codemods
Simple codemodods to beautify your code
### Setup & Run
```sh
npm install -g jscodeshift
git clone https://github.com/peoplenarthax/cleaner-codemods.git
jscodeshift -t
```### Included Scripts
#### `destructure-proptypes`
```sh
jscodeshift -t cleaner-codemods/transforms/destructure-proptypes.js
```
It transforms propTypes objects assigments from:
```sh
import PropTypes from 'prop-types';class SomeClass {
...
}
SomeClass.propTypes = {
variable: PropType.object,
another: PropType.any,
}
```
to:
```sh
import {any, object} from 'prop-types';class SomeClass {
...
}
SomeClass.propTypes = {
variable: object,
another: any,
}
```It only supports imports from prop-types by the moment.
Work in progress