UNPKG

move-prop-types

Version:

"Help quickly replace the prop type checker in older react projects to map to prop-types"

24 lines 823 B
/** * AST-based PropTypes transformation using Babel * * This module provides a more robust and accurate transformation compared to regex-based approach. * Benefits: * - Understands JavaScript/TypeScript syntax correctly * - Handles complex cases and edge cases better * - Preserves code formatting and comments where possible * - More maintainable and less error-prone */ interface TransformationResult { code: string; modified: boolean; } /** * Main transformation function using AST */ export declare function transformWithAST(code: string, filename?: string): TransformationResult; /** * Check if file needs PropTypes transformation using AST analysis */ export declare function needsTransformation(code: string, filename?: string): boolean; export {}; //# sourceMappingURL=ast-transformer.d.ts.map