Skip to content

peoplenarthax/cleaner-codemods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cleaner-Codemods

Simple codemodods to beautify your code

Setup & Run

npm install -g jscodeshift
git clone https://github.com/peoplenarthax/cleaner-codemods.git
jscodeshift -t <codemod-script> <file>

Included Scripts

destructure-proptypes

jscodeshift -t cleaner-codemods/transforms/destructure-proptypes.js <file>

It transforms propTypes objects assigments from:

import PropTypes from 'prop-types';

class SomeClass {
...
}
SomeClass.propTypes = {
variable: PropType.object,
another: PropType.any,
}

to:

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

About

Simple codemods to beautify your code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published