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: 11 days ago
JSON representation

Simple codemods to beautify your code

Lists

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