mirror of
https://github.com/ritz078/transform.git
synced 2026-11-21 00:32:56 +03:00
added immutable propTypes
This commit is contained in:
1 parent
4d768c77c9
commit
6a8290bbfc
2 files changed
+13
No files matched your search
@@ -68,6 +68,12 @@ export default function({ types: t }) {
|
||||
path.replaceWith(t.identifier("PropTypes.bool"));
|
||||
},
|
||||
|
||||
VariableDeclaration(path) {
|
||||
path.insertBefore(t.identifier(`import ImmutablePropTypes from 'react-immutable-proptypes'
|
||||
import PropTypes from 'prop-types
|
||||
`))
|
||||
},
|
||||
|
||||
Program(path) {
|
||||
path.traverse({
|
||||
enter(path) {
|
||||
|
||||
@@ -76,6 +76,13 @@ export default function({ types: t }) {
|
||||
});
|
||||
},
|
||||
|
||||
VariableDeclaration(path) {
|
||||
path.insertBefore(t.identifier(
|
||||
`import PropTypes from 'prop-types'
|
||||
`))
|
||||
},
|
||||
|
||||
|
||||
ObjectExpression(path) {
|
||||
if (
|
||||
t.isVariableDeclarator(path.parent) ||
|
||||
|
||||
Reference in new issue
Block a user