Option to create types without deleting PropTypes
seanf opened this issue · 2 comments
seanf commented
In a large JS/TS (partially typed) codebase, it can be useful to keep the PropTypes around for some runtime type verification, at least for a while.
Obviously there's a risk over time of losing consistency between the PropTypes and the TS types, but I think it can be a useful migration strategy.
seanf commented
My workaround for now is to comment out the last three lines of allTransforms
in ~/.vscode/extensions/mohsen1.react-javascript-to-typescript-transform-vscode-$VERSION/node_modules/react-js-to-ts/dist/index.js
exports.allTransforms = [
react_move_prop_types_to_class_transform_1.reactMovePropTypesToClassTransformFactoryFactory,
react_js_make_props_and_state_transform_1.reactJSMakePropsAndStateInterfaceTransformFactoryFactory,
react_stateless_function_make_props_transform_1.reactStatelessFunctionMakePropsTransformFactoryFactory,
collapse_intersection_interfaces_transform_1.collapseIntersectionInterfacesTransformFactoryFactory,
// react_remove_prop_types_assignment_transform_1.reactRemovePropTypesAssignmentTransformFactoryFactory,
// react_remove_static_prop_types_member_transform_1.reactRemoveStaticPropTypesMemberTransformFactoryFactory,
// react_remove_prop_types_import_1.reactRemovePropTypesImportTransformFactoryFactory,
];
dschaller commented
Thank you for you contribution to this repository.
Closing this contribution as this repository is being archived.